Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    4xz
    4xz is offline
    Regular Coder
    Join Date
    Aug 2004
    Location
    localhost
    Posts
    163
    Thanks
    0
    Thanked 1 Time in 1 Post

    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 ?

  • #2
    Regular Coder
    Join Date
    Oct 2004
    Posts
    168
    Thanks
    0
    Thanked 5 Times in 5 Posts
    The data associated with disabled form elements is not submitted.
    How about using readonly instead?

  • #3
    4xz
    4xz is offline
    Regular Coder
    Join Date
    Aug 2004
    Location
    localhost
    Posts
    163
    Thanks
    0
    Thanked 1 Time in 1 Post
    Readonly on a select does not work

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #5
    4xz
    4xz is offline
    Regular Coder
    Join Date
    Aug 2004
    Location
    localhost
    Posts
    163
    Thanks
    0
    Thanked 1 Time in 1 Post
    I worked around this by showing a textlable with the value, but I would have loved to have a readonly selectbox


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •