Page 1 of 1

populating a select list

Posted: Thu Feb 13, 2014 10:23 am
by Mich

I am trying to populate a selct list. The data is already there (i.e. forget json/ajax for now)

To test, I added a load event with:
code
var foo= '1,text1|2,text2|3,text3|4,text4';
var sx = foo.split('|');

var options = Appery ('presentation_open_slots');

for (var idx = 0; idx < sx&#46;length; idx++) {
var sx = sx[idx]&#46;split(',');
var val_option = sx[0];
var text_option = sx[1];

Code: Select all

 options&#46;append('<option value="'+ val_option + '">'+ text_option+ '</option>'); 

}
options&#46;selectmenu('refresh');
/code
This JS is pretty basic.... but it's a test.

I get a select list with text1 and undefined... still looking