Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 67 votes, 2.66 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-05-2005, 04:28 PM   PM User | #1
4xz
Regular Coder

 
Join Date: Aug 2004
Location: localhost
Posts: 163
Thanks: 0
Thanked 1 Time in 1 Post
4xz is an unknown quantity at this point
Disabled selectbox value not being POST-ed ?

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 ??
Code:
<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>
</select>
When this element is submitted, the value is gone ?? Without the disabled='disabled' argument the value is coming through....

Is this normal form behaviour ?
4xz is offline   Reply With Quote
Old 03-05-2005, 08:42 PM   PM User | #2
Puffin the Erb
Regular Coder

 
Join Date: Oct 2004
Posts: 168
Thanks: 0
Thanked 5 Times in 5 Posts
Puffin the Erb is an unknown quantity at this point
The data associated with disabled form elements is not submitted.
How about using readonly instead?
Puffin the Erb is offline   Reply With Quote
Old 03-06-2005, 09:24 PM   PM User | #3
4xz
Regular Coder

 
Join Date: Aug 2004
Location: localhost
Posts: 163
Thanks: 0
Thanked 1 Time in 1 Post
4xz is an unknown quantity at this point
Readonly on a select does not work
4xz is offline   Reply With Quote
Old 03-06-2005, 09:41 PM   PM User | #4
redhead
Regular Coder

 
Join Date: Jun 2002
Location: United Kingdom Confused: Often
Posts: 859
Thanks: 0
Thanked 0 Times in 0 Posts
redhead is an unknown quantity at this point
A suggestion...

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?
__________________
redhead
redhead is offline   Reply With Quote
Old 03-07-2005, 06:57 PM   PM User | #5
4xz
Regular Coder

 
Join Date: Aug 2004
Location: localhost
Posts: 163
Thanks: 0
Thanked 1 Time in 1 Post
4xz is an unknown quantity at this point
I worked around this by showing a textlable with the value, but I would have loved to have a readonly selectbox
4xz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:13 PM.


Advertisement
Log in to turn off these ads.