views:

995

answers:

3

i have a textbox associated with a calendar extender and a masked edit extender in a asp.net 3.5 project. i would like to clear the texbox when OnBlur...i have tried using the code below but it not working! any ideas guy?

document.getElementById('txtDtTo').value ="";
+1  A: 

There are many reported problems with the OnBlur event firing, the code to clear the text box looks fine. Why do you need it empty when it loses focus? You could use the OnChange event instead however if I understand your proposed logic correctly you'll always have an empty text box!

Dave Anderson
i'm comparing the textbox with another textbox, so when the condition return false, the textbox shoud be clear.
WeeShian
A: 

use this:

document.getElementById("<%=txtDtTo.ClientID%>").value ="";
iburlakov
still not working....
WeeShian
A: 

I am also facing the same problem.. .Any solutions guyz ??

ManojB