Click here to Skip to main content
15,916,091 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi ,
How can I know weather the text in the textbox has changed or not ?using an if condition
not with the textchanged event...

Please Help Me........
Thanks In Advance........
Posted

Hi,

You question is not clear, whether you want to check this with javascript or codebehind?

Please look into the below link...


http://asp-net-example.blogspot.in/2009/03/how-to-use-ontextchanged-event-in.html[^]
 
Share this answer
 
Comments
[no name] 24-Apr-13 9:02am    
I Want to know is there any possibility to check with out text changed event
If you want to fire an event other than textchanged when the text is changed in the textbox , then do like this


ASP.NET
<asp:textbox runat="server" id="tb1" xmlns:asp="#unknown"></asp:textbox>


Add onblur event to the textbox in code behind like this
C#
tb1.Attributes.Add("onblur", "javascript:tbFn(this);");


JavaScript
function tbFn(tb) {
       var text = tb.value;
   }


where the variable text contains the entered value.
If you want to compare with its previous values, store it in some session and compare the values.

Hope this helps...
 
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