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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I set a field on a form to verify another? 1

Status
Not open for further replies.

teltech81

Vendor
Apr 11, 2001
3
0
0
US
On my form I want the user to verify e-mail address. If they don't type them the same I want an error message to alert them. Is it possible?
 
Here's one that may help:

<HTML>
<HEAD>
<TITLE>Password Check</TITLE>
<SCRIPT LANGUAGE=JAVASCRIPT TYPE=&quot;TEXT/JAVASCRIPT&quot;>
<!-- Hide script from older browsers

function validForm(passForm) {
if (passForm.passwd1.value == &quot;&quot;) {
alert(&quot;You must enter a password&quot;)
passForm.passwd1.focus()
return false
}
if (passForm.passwd1.value != passForm.passwd2.value) {
alert(&quot;Entered passwords did not match&quot;)
passForm.passwd1.focus()
passForm.passwd1.select()
return false
}
return true
}

// End hiding script -->
</SCRIPT>
</HEAD>
<BODY BGCOLOR=WHITE>
<FORM onSubmit=&quot;return validForm(this)&quot; ACTION=&quot;someAction.cgi&quot;>
Your name: <INPUT TYPE=TEXT SIZE=30>
<P>Choose a password: <INPUT TYPE=PASSWORD NAME=&quot;passwd1&quot;>
<P>Verify password: <INPUT TYPE=PASSWORD NAME=&quot;passwd2&quot;>
<P><INPUT TYPE=SUBMIT VALUE=&quot;Submit&quot;> <INPUT TYPE=RESET>
</FORM>
</BODY>
</HTML>

f. :eek:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top