Here is my code:
jQuery('#reporter').blur(function() {
if(data.indexOf('['+jQuery('#reporter').val()+']') >= 0)
{
alert("Please do not select pseudo user as Reporter");
jQuery('#reporter').focus();
}
});
In IE, the cursor is not blinking in the "reporter" element. In Chrome, it is.
Thanks a lot!
You'll need to set the blur later by using a timeout. The other control might execute focus first.
window.setTimeout(function(){
$('#reporter').focus();
}, 50);
This gives IE the time to focus the other control, steal the focus and then add it to #reporter
.
$('#reporter').blur(function(e) {
if(data.indexOf('[' + jQuery('#reporter').val() + ']') >= 0) {
alert("Please do not select pseudo user as Reporter");
$('#reporter').focus();
e.preventDefault();
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With