php_novice2007 Posted July 4, 2007 Share Posted July 4, 2007 Hi, I'm writing a page which allows someone to reset their password. I have 2 text fields for them to type in the new password 2 times. I want to have a check box above them so that when the user clicks on the check box, these two fields appear, otherwise they should be hidden. How can I go about doing this? I can't seem to find any tutorial on how this can be done either.. thanks Quote Link to comment https://forums.phpfreaks.com/topic/58343-making-input-field-appear-and-disappear/ Share on other sites More sharing options...
Lefu Posted July 4, 2007 Share Posted July 4, 2007 ok, there is a javascript function to reload() the screen and this you can start by making onclick event for your check box, then you make use of if-then statement to verify that when the checkbox is selectect you display the fields. this fields will be displayed inside your if-then statement, i.e if ($_POST["chkMe"]) { display your text fields here... } I hope u do understand what I'm saying, Quote Link to comment https://forums.phpfreaks.com/topic/58343-making-input-field-appear-and-disappear/#findComment-289492 Share on other sites More sharing options...
ToonMariner Posted July 4, 2007 Share Posted July 4, 2007 You don't need to reload the page. google javascript div toggle for some examples on how to show/hide an element. with the onclick even of the checkbox you can call the function that shows are hides the bits you want. Quote Link to comment https://forums.phpfreaks.com/topic/58343-making-input-field-appear-and-disappear/#findComment-289495 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.