| Article: |
A Simpler Ajax Path | |
| Subject: | select-one in formData2QueryString | |
| Date: | 2005-11-16 08:09:05 | |
| From: | inthe80s | |
|
While the code provided will work fine in a decent browser like Firefox, Internet Explorer still requires you to pull the index and refer to the text and not just pull the value of the form element. So remove case 'select-one' from the switch, and add it back as a seperate one here:
|
||
Showing messages 1 through 1 of 1.
-
select-one in formData2QueryString
2005-12-16 10:04:33 brucehodo [View]



Using the above example:
strSubmitContent += formElem.name + '=' + escape(formElem.options[formElem.selectedIndex].text) + '&'
will return the label of the selected option. Substituting "value" for "text" will return the assigned value of the selected option.