Topic: populating a select list (Page 1 of 1) |
|
---|---|
Nervous Wreck (II) Inmate From: |
![]() Hi there, I have the following code: ( which does not seem to work... any ideas ? ). I dont seem to get any errors, but yet the form remains unpopulated. code: document.data.location[location.length] = new Option(OptionText, OptionValue);
code: <select id="dd_location2" name="location"> <option value="0"></option> <option value="4" >Other Locations</option> </select>
code: document.getElementById('dd_location2').length = new Option(OptionText, OptionValue);
|
Paranoid (IV) Inmate From: Norway |
![]() Holy moly!!! |
Nervous Wreck (II) Inmate From: |
![]() Actually I had already done that and led me to the code you see before you. |
Paranoid (IV) Inmate From: Norway |
![]() Right. |
Lunatic (VI) Inmate From: under the bed |
![]() quote:
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() Um the first link on the google seach seems to return the same method he has |
Paranoid (IV) Inmate From: Norway |
![]() Ok, ok the first link on my first google search is a bit incorrect : code: document.getElementById('dd_location2').length = new Option(OptionText, OptionValue); you can see it doesn't make sense. Length equal new option. No, that's not what you want. What you want is to add an option to the collection of options of a select. |