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
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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.