i want to sort the drop down items using javascript,can anyone tell me how to do this.
We use the following valid_if formulas to sort the values that appear in the dropdown menus: 1. ORDERBY(Person[Key], [First Name]) 2. ORDERBY(Person[Key], [Last Name]) 3. ORDERBY(Person[Key], [First Name], TRUE) 4.
A dropdown list is a toggleable menu that allows the user to choose one option from multiple ones. The options in this list are defined in coding, which is associated with a function. When you click or choose this option, that function triggers and starts performing.
You could use jQuery and something like this:
$("#id").html($("#id option").sort(function (a, b) { return a.text == b.text ? 0 : a.text < b.text ? -1 : 1 }))
But it's probably better to ask why and what you're trying to accomplish.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With