Hide text boxex

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ghjk
    Contributor
    • Jan 2008
    • 250

    #1

    Hide text boxex

    I have a drop down box with two values(yes , no). When i select yes i have to hide text box below that and (it should already hide) and when select 'no' it should apper. How can i do that?
    i put if (isset($_GET['name'])). then is is hidden and when i select 'no' it will not apper? Could u pls help me.
  • rpnew
    New Member
    • Aug 2007
    • 189

    #2
    Originally posted by ghjk
    I have a drop down box with two values(yes , no). When i select yes i have to hide text box below that and (it should already hide) and when select 'no' it should apper. How can i do that?
    i put if (isset($_GET['name'])). then is is hidden and when i select 'no' it will not apper? Could u pls help me.
    Hi,
    well from your explaination what i understood is... you want to do above on client side..... means when your page is loaded and then if user selects 'yes' or 'no' accordingly textbox shoud appear or hide. well if you want to do this with PHP then you have to submit your page or say reload your page as PHP only works on server side... however for doing it on client side you need to work with Javascript.. which is handy and easy to use... so what is your case??

    Regards,
    RP

    Comment

    • ghjk
      Contributor
      • Jan 2008
      • 250

      #3
      i want to do on server side

      Comment

      • rpnew
        New Member
        • Aug 2007
        • 189

        #4
        Originally posted by ghjk
        i want to do on server side
        Hi,
        Even for that i think you need to use a bit of javascript... Cause to do it on server side you need to submit the page with the value.. And you can do that by using a bit of javascript'- dropdownbox onchange event....
        I hope you've put all these components in a form so on onchange event you can submit the form to the same page with dropdownbox's value.... and while loading you can use that value to set the <input > type hidden or text....

        So to use the above logic... you can use the code below....
        to submit a from withe name 'XXX' through javascript with onchange event of drop box....
        [HTML]
        <select onchange="javas cipt: form_submit();" >
        ......
        </select>
        [/HTML]
        [CODE=javascript]
        function form_submit()
        {
        document.XXX.su bmit();
        }
        [/CODE]

        Regards,
        RP

        Comment

        Working...