I have validate a text field with onchange event which throw error message, if not satisfied the condition and set the mouse cursor on the same field using document.focus().
It is working fine in IE, but when used in Firefox, the mouse cursor is moving to the next text field.
Please let me know the possible solution for the above problem.
I have used that code already, it is not working in Mozilla when onchange event is throwing error message. The mouse cursor is moving to the next text field after showing the error message.
var find=/[0-9\*\=\_\>\<\:\@\&\%\?\$\)\(\`\~\#\^\|\+\.\,\;\\\}\{\]\[\\"\!\/\-\']/; var maxchars=20;
if(document.personal.person_name.value.length > maxchars) { alert('Too much data in the text box! Please remove '+ (document.personal.person_name.value.length - maxchars)+ ' characters');
Hi, It is also not working with document.formname in Mozilla. I have tried the setTimeout function but what happened in Mozilla, it selects the text box value after showing error message but mouse cursor can be moveable to the next field which is not occuring in IE.