Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have to trigger the JAVASCRIPT function for asp Control Textbox,for Restricting the number of character,

My question is how to trigger the javascript function without changing the codebehind i.e., .cs file,is it possible to call the javascript function without the firing the events..
Posted
Comments
rkthiyagarajan 16-Sep-11 0:58am    
Hi.. You ask javascript but why you filter that? Use key lenght in javascrpit.
$aikumar$ Cilamkoti 16-Sep-11 1:03am    
hey hi thanks for ur reply..actually i have a requirement regarding calling the javascript function on asp control textbox ctrl without firing any events

To Limit Number Of Characters In an ASP.NET Multiline TextBox using jQuery
Refer

http://www.dotnetcurry.com/ShowArticle.aspx?ID=396[^]


may help
 
Share this answer
 
I think you can use Maxlength property of textbox.
Why you want go for javascript?
 
Share this answer
 
hi...

The solution link you have provided is working fine but when i try the same in VS 2003 its not working. Even i have added a alert message in that javascript but i didnt get the alert when i press the key... which actually tell that the event is not even fired.

can you provide the any solution for that.
 
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