Questions and discussion about using ProcessMaker 2: user interface, running cases and functionality

Moderator: ArturoRobles

Forum rules: Please search to see if a question has already been asked before posting. Please don't ask the same question in multiple forums.
By gbalbach
#828792
Is it possible to sort a dropdown list in Javascript? The code below is from the wiki link posted below. I am reading in a json list that is not sorted correctly and either during or after I use code similar to the example below I want to sort it by the text - the "opt.text = aProducts[1];" value. Is this possible in javascript right after or while I load the drop down list?

https://wiki.processmaker.com/index.php/2.0/Dropdown_Boxes_and_Listboxes#Accessing_Dropdowns_with_JavaScript

var aProducts = eval(getValueById("sProducts"));
if (typeof(aProducts) == 'object' && aProducts.length) { //if an array
for (var i=0; i < aProducts.length; i++) {
var opt = document.createElement("OPTION");
opt.value = aProducts[0];
opt.text = aProducts[1];
getField("selectProducts").options.add(opt);
}
}
paper writers legitimacy

As a student you should know where to order your a[…]

Dear All, As per my post above I have spend some t[…]

SCHEDULER MISSING

Your article is very good I like it. and also ever[…]

Data Loss

Hi, In some cases I have a problem, the data is a[…]