Try return false;
from within the if statement.
if(pass1.value != pass2.value)
{
alert("don't match");
return false; // Abort
}
Also as @Lloyd said, check for values, not elements.
Try return false;
from within the if statement.
if(pass1.value != pass2.value)
{
alert("don't match");
return false; // Abort
}
Also as @Lloyd said, check for values, not elements.