Best layout tool to use for ascending numbers ?

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
dannac
 
 
Posts: 206
Joined: Wed Nov 13, 2019 8:46 pm

Best layout tool to use for ascending numbers ?

Post by dannac »

Is there a layout tool to use where I could input random numbers on a page and they will auto set
to ascending. ( total numbers could be 50 are more )

Lets say I have
1345 ... 1567 ... 1824 ... 2020 ...

Then I input 1649 and the layout would adjust to

1345 ... 1567 ... 1649 ... 1824 ... 2020
User avatar
BaconFries
 
 
Posts: 5867
Joined: Thu Aug 16, 2007 7:32 pm

Re: Best layout tool to use for ascending numbers ?

Post by BaconFries »

Sorry there is no specific layout tool as this will require a custom solution with the likes of javascript.
dannac
 
 
Posts: 206
Joined: Wed Nov 13, 2019 8:46 pm

Re: Best layout tool to use for ascending numbers ?

Post by dannac »

Ok thanks !
User avatar
BaconFries
 
 
Posts: 5867
Joined: Thu Aug 16, 2007 7:32 pm

Re: Best layout tool to use for ascending numbers ?

Post by BaconFries »

With a little help of AI you can try the following:
Using the HTML Object insert the following using between the <body></body> tags* and place the object where you wish on the page.

Code: Select all

<input type="text" id="numberInput" placeholder="Enter numbers separated by commas">
<button onclick="sortUserInput()">Sort Numbers</button>
<div id="numbers-container"></div>
<script src="script.js"></script>
Copy the following and add inside of a text file save as script.js. Now you need upload to your host/server you can do this manually or you can use the File Publisher Object and add to it and then publish the page. Note that this is provided untested and for information only

Code: Select all

function sortUserInput() {
    // Get the user input from the text field
    const input = document.getElementById('numberInput').value;

    // Split the input into an array of numbers
    const numbers = input.split(',').map(Number).filter(num => !isNaN(num));

    // Sort the numbers in ascending order
    const sortedNumbers = numbers.sort((a, b) => a - b);

    // Display the sorted numbers
    const numbersContainer = document.getElementById('numbers-container');
    numbersContainer.innerHTML = `<p>Original Numbers: ${numbers.join(', ')}</p>`;
    numbersContainer.innerHTML += `<p>Sorted Numbers: ${sortedNumbers.join(', ')}</p>`;
}
Post Reply