I have a javascript that test to make sure the two passwords entered are the same, but right now it does it onkeyup. Is there a way I can make it so that it either checks whenever the field leaves focus, or if they pause for a few seconds? This is what my script looks like now:
[CODE]<input type=”password” name=”password2″ id=”p2″ onKeyUp=”checkPass(‘p1’, ‘p2’)”>
<span id=”status”></span>
[CODE]<script>
function checkPass ( p1, p2 )
{
pass1 = document.getElementById ( p1 ) .value;
pass2 = document.getElementById ( p2 ) .value;
if ( pass1 != pass2 )
{
document.getElementById ( ‘status’ ) .innerHTML = ‘ <img src=images/no.gif align=absmiddle>
<font color=”darkred” face=”Verdana” size=”1″>Passwords do not match.</font>’;
}
else
{
document.getElementById ( ‘status’ ) .innerHTML = ‘ <img src=images/yes.gif align=absmiddle>
<font color=”darkgreen” face=”Verdana” size=”1″>Success!</font>’;
}
}
</script>