Topic: populating a select list |
|
---|---|
Author | Thread |
Nervous Wreck (II) Inmate From: |
posted 10-25-2006 18:16
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 |
posted 10-25-2006 18:48
Holy moly!!! |
Nervous Wreck (II) Inmate From: |
posted 10-25-2006 19:28
Actually I had already done that and led me to the code you see before you. |
Paranoid (IV) Inmate From: Norway |
posted 10-25-2006 19:40
Right. |
Lunatic (VI) Inmate From: under the bed |
posted 10-26-2006 05:44
quote:
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 10-26-2006 16:54
Um the first link on the google seach seems to return the same method he has |
Paranoid (IV) Inmate From: Norway |
posted 10-26-2006 17:32
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. |