Menu
I’m new to JavaScript and downloaded a script to verify two password fields in a form. I added it to my code, but it doesn’t do anything at all. I put the script in the head tag and added the onSubmit to point to my script — just like the instructions.
What am I doing wrong?
Here’s the script:
<!– Begin
function checkPw(form) {
alert(“got here”)
pw1 = form.pw1.value;
pw2 = form.pw2.value;
if (pw1 != pw2) {
alert (“nYou did not enter the same new password twice. Please re-enter your password.”)
return false;
}
else return true;
}
// End –>
</script>