#30 — empty option values not submitted properly
State | Unconfirmed |
---|---|
Release: | 1.4 |
Area | Client side framework and general |
Issue type | Bug |
Severity | Medium |
Submitted by | (anonymous) |
Submitted on | 2008-08-22 |
Responsible |
—
|
Target release: |
—
|
Last modified on
2008-08-22
When submitting a form using kssSubmitForm: currentForm(), if the form includes the following option:
<option value="">my option</option>
KSS sends "my option" as the field value, instead of "" as I would expect.
This appears to be thanks to the following code in fo.getValueOfFormElement in forms.js:
var option = element.options[element.selectedIndex]
// on FF and safari, option.value has the value
// on IE, option.text needs to be used
value = option.value || option.text;
<option value="">my option</option>
KSS sends "my option" as the field value, instead of "" as I would expect.
This appears to be thanks to the following code in fo.getValueOfFormElement in forms.js:
var option = element.options[element.selectedIndex]
// on FF and safari, option.value has the value
// on IE, option.text needs to be used
value = option.value || option.text;