Hello,
I am doing form validation using 'onChange', so that every time a text
input is entered and focus is lost on that text input, it will check to make
sure it is an integer:
function InputCheck(oThis);
if (isNaN(oThis.value) || (oThis.value.indexOf('.') > 0))
{
alert('The Entered Code Number Must Be an INTEGER -- No Alpha or
Special Characters Allowed.');
oThis.value='';
oThis.blur();
oThis.focus();
}
The problem is that, say I type "hello" in the text input. It will give
the alert and then clear the value in the text box, as it should. The
problem is that if I type "hello" again a second time, it accepts it. It
seems that even though I clear the value in the text box when the input
isn't valid, 'onChange' doesn't know it is cleared and so entering the same
thing a second time doesn't look like a change to it.
As you can see in my function, I tried to blur() and focus() with the
cleared value to try to force onChange to see the cleared value...
So, how do you get around this problem?
Thanks in advance,
Scott Navarre