PDA

View Full Version : ComboBox Value vs Display when Value is an empty string



Troy Wolf
26 Sep 2007, 10:12 AM
This is not the common question about "why does my combobox value give me the display instead of the value?" I know about hiddenName, thank you.

Let's say I have a ComboBox with these values. (I will illustrate this using standard select HTML.):



<option value=''>[ Select all options ]</option>
<option value='1'>Option 1</option>
<option value='2'>Option 2</option>
<option value='3'>Option 3</option>


What I want to be passed to my server-side script is the value, of course, not the display. So I use hiddenName and this works great.....that is until one of my 'value' values is an empty string.

For example, with the data above, if the user selects "Option 1", Ext submits the value "1" to my script. If the user selects "[ Select all options ]", I expect to be passed the empty string "". HOWEVER, instead, Ext, I guess, says "oh, you asked for the value, but it's empty, so let me help you and give you the display value instead". So "[ Select all options ]" is passed to my script.

This is exactly what I'd expect from Microsoft -- thanks for the "help", Bill. I do not expect this from Ext...so I'm giving this one the benefit of the doubt and assuming I have missed a basic configuration.