I came across a bug with Google chrome ver 1.0.154.43 while answering a problem in asp.net forums.
Problem:
Chrome browser ignores "onblur" event function for input box while it has Required field validator attached to it . Check this code..
<input id="txt1" runat="server" type="text" maxlength="16" style="width: 127px" onblur= "formatSSN();"/>
<asp:RequiredFieldValidator ID="Rfssn" runat="server" ControlToValidate="txt1" Display="None" ErrorMessage="SSN"
SetFocusOnError="True" EnableViewState="False">
</asp:RequiredFieldValidator>
<script language="javascript" type="text/javascript">
function formatSSN()
{
var ssn = document.getElementById("txt1").value;
if(ssn.length == 9)
{
document.getElementById("txt1").value= ssn.substring(0, 3) +"-" + ssn.substring(3, 5) + "-" + ssn.substring(5, 9);
return false;
}
}
</script>
The code works fine in IE6/7 & FireFox3, but not in Google chrome .
Solution:
I think the problem is with required field validator's SetFocusOnError property. Setting SetFocusOnError="false" for Rfv will fix it in chrome.