You are here: irt.org | FAQ | JavaScript | Form | 6 | Q777 [ previous next ]
You need a polling JavaScript function that doesn't tie up the browser, but returns control back to the browser for a while they checks again:
<FORM NAME="myForm">
<INPUT TYPE="TEXT" NAME="myText">
</FORM>
<SCRIPT LANGUAGE="JavaScript"><!--
function monitorText() {
if (document.myForm.myText.value.indexOf('skip') > -1)
alert('detected skip');
else
setTimer('monitorText()',1000); // checks field every 1000 milliseconds
}
monitorText();
//--></SCRIPT>