Thanks to the help of RNK and StarWay, I am now using the following script to verify password entries. My next task is this. If the entries do not match, I would like for the 2 password fields to be cleared and the focus returned to the 1st field. Currently, the script checks the 2 values, and returns both an alert and the Focus to the 1st field. Can this be done? Thanks again!
html>
<head>
<title>
test
</title>
<script language="javascript" type="text/javascript">
<!--
function validatePass(){
var frm = window.document.forms['register'];
if(frm.pass.value != frm.repass.value){
alert("Your passwords do not match\n"+
"please re-enter your password"
frm.pass.focus();
return false;
}
}
//-->
</script>
</head>
<body>
<form name="register">
<p><input type="password" name="pass" onfocus="this.select();" /></p>
<p><input type="password" name="repass" onblur="validatePass();" onfocus="this.select();"/></p>
</form>
</body>
</html>
html>
<head>
<title>
test
</title>
<script language="javascript" type="text/javascript">
<!--
function validatePass(){
var frm = window.document.forms['register'];
if(frm.pass.value != frm.repass.value){
alert("Your passwords do not match\n"+
"please re-enter your password"
frm.pass.focus();
return false;
}
}
//-->
</script>
</head>
<body>
<form name="register">
<p><input type="password" name="pass" onfocus="this.select();" /></p>
<p><input type="password" name="repass" onblur="validatePass();" onfocus="this.select();"/></p>
</form>
</body>
</html>