Hide/show a text box based on drop down list in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TechnoAtif
    New Member
    • Sep 2007
    • 63

    #1

    Hide/show a text box based on drop down list in php

    HI..

    I am looking for php code that will enable me to hide/show a text box based on the users previous drop down list response. If javascript comes into use for it,
    its a welcome solution

    (1) I want the "additional " text box to ONLY display if the user answers the drop down list with "yes"
    (2) If the user answers "no" to the previous drop down list I don't want the "additional " text box displayed
    (3) When the form is originally opened I dont want it to display the "additional " text box.

    Reagards
    TechnoAtif
  • stepterr
    New Member
    • Nov 2007
    • 157

    #2
    Originally posted by TechnoAtif
    HI..

    I am looking for php code that will enable me to hide/show a text box based on the users previous drop down list response. If javascript comes into use for it,
    its a welcome solution

    (1) I want the "additional " text box to ONLY display if the user answers the drop down list with "yes"
    (2) If the user answers "no" to the previous drop down list I don't want the "additional " text box displayed
    (3) When the form is originally opened I dont want it to display the "additional " text box.

    Reagards
    TechnoAtif
    If you were to do javascript just use an onchange event that will call the javascript function that will be used to evaluate what the user selected. Then depending on what they select just enable or disable the text box element by it's id. When the form is originally opened just default the text box to the disabled state.

    Comment

    Working...