Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare two password fields

Status
Not open for further replies.

shiggyshag

Programmer
Dec 14, 2001
227
GB
Hi

Before I submit my form I want to check that newpassword and confirmpassword have the same value.

Any ideas on the best way to achieve this

Cheers
 
Its ok i found some javascript that does the job

<SCRIPT LANGUAGE=JAVASCRIPT>
<!--

function checkpassword() {
if (document.forms.form1.newpassword.value != document.forms.form1.confirmpassword.value)
{ alert ('Those emails don\'t match!');
return false; }
else
{ return true; }
}
//-->
</SCRIPT>
 
Just as a note, you might want to change the alert from &quot;Those emails don't match&quot; to &quot;Thse passwords don't match&quot;.


The money's gone, the brain is shot.....but the liquor we still got.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top