disneyfan
03-08-2005, 01:40 PM
Here's ya one to help me with...
When the user clicks the submit button a function should compare the values entered in the password boxes. If the values are the same, the forms data should be submitted. If different alert the user. The forms data should NOT be sent before verifying.
can you help?
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Learning Javascript</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
function chkPassword() {
if (document.infoForm.txtPass1.value == document.infoForm.txtPass2.value) {
// FORM SUBMIT CODE???
else
//ALERT USER VALUES DOES NOT MATCH
}
// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</SCRIPT>
</head>
<body>
<form action="mailto:myemailaddress@home.com"
Method="post" enctype="text/plain" name="infoForm">
<p>Email: <input type="text" name="txtEmail" size="24"> Password:
<input type="password" name="txtPass1" size="20"> Verify Password:
<input type="password" name="txtPass2" size="20"></p>
<p>
<input type="submit" value="Submit" name="button_Submit" onclick=chkPassword()>
<input type="reset" value="Reset" name="button_Reset">
</p>
</form>
</body>
</html>
When the user clicks the submit button a function should compare the values entered in the password boxes. If the values are the same, the forms data should be submitted. If different alert the user. The forms data should NOT be sent before verifying.
can you help?
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Learning Javascript</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
function chkPassword() {
if (document.infoForm.txtPass1.value == document.infoForm.txtPass2.value) {
// FORM SUBMIT CODE???
else
//ALERT USER VALUES DOES NOT MATCH
}
// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</SCRIPT>
</head>
<body>
<form action="mailto:myemailaddress@home.com"
Method="post" enctype="text/plain" name="infoForm">
<p>Email: <input type="text" name="txtEmail" size="24"> Password:
<input type="password" name="txtPass1" size="20"> Verify Password:
<input type="password" name="txtPass2" size="20"></p>
<p>
<input type="submit" value="Submit" name="button_Submit" onclick=chkPassword()>
<input type="reset" value="Reset" name="button_Reset">
</p>
</form>
</body>
</html>