I am trying to validate a text field content as the user types, instead of when they click out of it. here is what i had before
then i tried thisCode:onblur="javascript: validate(this.value, this.id, 1);"
here is some of the functionCode:onkeydown="javascript: validate(this.value, this.id, 1);"
Code:function validate(input, name, step) { if(step==1) { if(name=='name') { if (input==null || input=='') { document.getElementById('nameDiv').style.visibility='visible'; document.getElementById('next').disabled='disabled'; return false; } else { document.getElementById('nameDiv').style.visibility='hidden'; var emailField = document.getElementById('email').value; if(emailField!="" && emailField!=null) { document.getElementById('next').disabled=''; } } } //and so on..


Reply With Quote
Bookmarks