View Full Version : Disabled selectbox value not being POST-ed ?

03-05-2005, 05:28 PM
I use a disabled selectbox in a form, which has 1 option selected, the option HAS a value. When the form gets submitted, it is not submitting the disabled field ??

<select disabled='disabled' name='fab_id' id='fab_id' size='1'>
<option value='1'>Quick-Step</option>
<option value='2'>Balterio</option>
<option selected='selected' value='3'>Berry Floor</option>
<option value='4'>Novofloor</option>
<option value='7'>Eiken vloerdelen</option>

<option value='5'>Pergo</option>
<option value='6'>Huiscollectie</option>
<option value='8'>Tropisch hardhout</option>
<option value='9'>Kasteelvloeren</option>

When this element is submitted, the value is gone ?? Without the disabled='disabled' argument the value is coming through....

Is this normal form behaviour ?

Puffin the Erb
03-05-2005, 09:42 PM
The data associated with disabled form elements is not submitted.
How about using readonly instead?

03-06-2005, 10:24 PM
Readonly on a select does not work :(

03-06-2005, 10:41 PM
Hmmm... its a shame that disabled data isnt submitted and that readonly doesnt work for what you want... how about putting an additional hidden field in? That will be submitted to you and cannot be seen. I havent used disabled / readonly select boxes in the past so this is just a suggestion!

Any help or is this not a practical solution?

03-07-2005, 07:57 PM
I worked around this by showing a textlable with the value, but I would have loved to have a readonly selectbox :)