My HTML has an input text field that calls a javascript function when the field contents change (onChange).
The javascript function validates the data and if the data is in error sets the focus to the field with the error and returns false.
In NN 6.2 after clicking the "OK" in the alert error message box the cursor stays on the field in error for about 3 seconds and then jumps to the next input text field. How do I keep the cursor on the field in error so the user can correct the data?
In IE 5.5 it works incorrectly also, the cursor jumps to the next field right away.
In NN 4.7 it works correctly, the cursor stays on the field in error.
Here is my code
<td align="left" valign="top"><font size="4"><input type="text" name="application" value="" size=2 maxlength=3 onChange="return checkApplicationCode(this.value, this.name)">
</td>
function checkApplicationCode (s, n) {
if ((s != "lv") && (s != "LV") &&
(s != "tc") && (s != "TC"))
{
alert(n + " must be LV or TC. Please correct.");
window.document.forms[0].application.focus();
return false;
}
}
I appreciate any help you can give me. Thanks.
The javascript function validates the data and if the data is in error sets the focus to the field with the error and returns false.
In NN 6.2 after clicking the "OK" in the alert error message box the cursor stays on the field in error for about 3 seconds and then jumps to the next input text field. How do I keep the cursor on the field in error so the user can correct the data?
In IE 5.5 it works incorrectly also, the cursor jumps to the next field right away.
In NN 4.7 it works correctly, the cursor stays on the field in error.
Here is my code
<td align="left" valign="top"><font size="4"><input type="text" name="application" value="" size=2 maxlength=3 onChange="return checkApplicationCode(this.value, this.name)">
</td>
function checkApplicationCode (s, n) {
if ((s != "lv") && (s != "LV") &&
(s != "tc") && (s != "TC"))
{
alert(n + " must be LV or TC. Please correct.");
window.document.forms[0].application.focus();
return false;
}
}
I appreciate any help you can give me. Thanks.
Comment