Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I have attached the blur event in textbox. My cursor focus is in textbox, when i clicked on a
button then button click event does not fire first textbox blur event fire, so we need click on button twice. I checke this issue come in IE10, not other.

How can i resolve this issue?
Posted
Comments
Azee 1-Oct-13 7:43am    
Can you please post your blur event code and TextBox?
amit_83 1-Oct-13 7:54am    
<asp:TextBox ID="txtSize"
MaxLength="2" ClientIDMode="Static" runat="server" onblur="OnTextBoxBlur();">

function OnTextBoxBlur(sender) {
var elementId =sender.id;
var defaultText='Needed'
elementId = document.getElementById(elementId);
var textValue = $.trim(elementId.value);
if (textValue.length == 0) {
elementId.className = elementId.className + " Needcss";
elementId.value = defaultText;
}

}
Nandakishore G N 1-Oct-13 8:46am    
<asp:TextBox ID="txtSize"
MaxLength="2" ClientIDMode="Static" runat="server" onblur="OnTextBoxBlur();">

pass the object
<asp:TextBox ID="txtSize"
MaxLength="2" ClientIDMode="Static" runat="server" onblur="OnTextBoxBlur(this);">

try this

1 solution

On IE 10 with document mode: Standards you can't gain focus in div with a mouse click but only using Tab key. You can lose focus with a click outside the box.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900