how to send disabled textbox value to next page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • itsmenarwal
    New Member
    • Jan 2010
    • 20

    how to send disabled textbox value to next page

    HI everyone

    I have a textbox i have disabled it with a fix value(like in online papers if you solved first question and move to second question first question get disabled now u cant make editing into this).I want something like this.But i dont know how to send a disable box value to next page with post or get..

    Code:
    <input type="text" id="username" value="<?php echo $_SESSION['employee']['username']; ?>" disabled="disabled" />
    how i can send this box value to next page
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hey.

    You can't send a disabled textbox to the next page. If you want to send it, it needs to be enabled.

    I see two ways around this:
    • Use JavaScript to enable the box when the form is submitted.
    • Add a hidden <input> element that mirrors the box. You would use whatever script that disables/prints the box to set the hidden element as well.


    And then there is of course the option of using AJAX to send the value, but I don't know if that even fits what you are doing.

    Comment

    Working...