Jump to content

Recommended Posts

I just want to create a simple password check like most sites have, making sure you didn't have a typo when originally registering your password.

 

So essentially what I have is <input type="text" name="pass1"> and <input type="text" name="pass2"> and I'd like to rig something up on the form processing page that checks to make sure pass1 is equal to pass2 otherwise it returns an error.

 

Any help?

The form will have to be submitted in order for PHP to check the values. However using javascript you can control what happens with the form, such as disable the submit button if the passwords do not match and/or display an error message.

 

You'll want to look into javascript form validation. Here is a quick tutorial

http://www.w3schools.com/js/js_form_validation.asp

 

You can however use a javascript framework such as jQuery for form validation

http://yensdesign.com/2009/01/how-validate-forms-both-sides-using-php-jquery/

The form will have to be submitted in order for PHP to check the values. However using javascript you can control what happens with the form, such as disable the submit button if the passwords do not match and/or display an error message.

 

You'll want to look into javascript form validation. Here is a quick tutorial

http://www.w3schools.com/js/js_form_validation.asp

 

You can however use a javascript framework such as jQuery for form validation

http://yensdesign.com/2009/01/how-validate-forms-both-sides-using-php-jquery/

Exactly what I needed, thank you.

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.