Jump to content

password textbox must match


reel_biggy_fish

Recommended Posts

Hi,

 

i am really struggling to think what to search for or even what to do.  what i want to do is when a user wants to change his or her password i want two textboxes and both must match before they can continue so they dont make a mistake and never login again. could someone point me in the direction of what to search for.

 

would be very helpful

 

thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/212550-password-textbox-must-match/
Share on other sites

EDIT: Sorry, just noticed that this is in the JS section, not the PHP section. Anyhow, if you want to validate the fields with PHP, this will help :)

 

Form field validation. Something like this (brief) example should get you started:

 

<?php
if( $_POST['submitted'] == 'yes' ) {
     if( $_POST['pass_1'] != $_POST['pass_2'] ) {
          // fields don't match, so do something to indicate the error . . .
     }
}
?>
<form action="" method="post">
<input type="text" name="pass_1" />
<input type="text" name="pass_2" />
<input type="hidden" name="submitted" value ="yes" />
<input type="submit" name="submit" value="Submit Form" />
</form>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.