Hi

I have some code that validates a field. The code is called using the
onchange event for the input field. The code is;

function CheckDate(ObjectName)
{ if(!isDate(ObjectName))
{ msg = 'Date is not valid.';
alert(msg);
ObjectName.select();
ObjectName.focus();
}
}

The select() and focus() are not working. I suspect the problem is the
order of events. If I enter invalid data and press TAB, the warning
appears, but the cursor moves to the next field. I think the select() and
focus() may be working, but the key press (the TAB) is executed after the
script, so the focus moves to the next field. If I use the onblur event
instead of the onchange event, the code works. I'm guessing this is becuase
the onblur happens after the key press is executed. I can't use the onblur
event for other reasons. Is there anyway to get the onchange event working
with validation code that moves the focus?

Thanks for your help.