Employers - Post Free Jobs
Forum guidelines
AuthorQuestion
How to call Java Script function in ASP.NET TextBox OnTextChanged Event
Posted on: 03 Mar 2011

Hai,
I have two text boxes named txtDOB (Date Of Birth), and txtDOJ (Date of Join)
i have to compare both text boxes DOJ is not greater than DOB..
For this i wrote a java script function, my problem is how to cal that
java script function in txtDoJ's "OnTextChanged Event ",

If u know help me..

Thanks and Regards,
Honey.

AuthorReply
Re: How to call Java Script function in ASP.NET TextBox OnTextChanged Event
Posted on: 03 Mar 2011  
Try this: txtDoJ.Attributes.Add("onblur", "checkDates()"); Assuming checkDates() is the javascript function which you wrote. HTH
Happy Programming!!!

Regards,
Raja
Re: How to call Java Script function in ASP.NET TextBox OnTextChanged Event
Posted on: 03 Mar 2011  
try this
onTextChanged="javascript:JavscriptFunctionName()
It may help you.

Mark as "This Is Correct Answer" if helps you.
Re: How to call Java Script function in ASP.NET TextBox OnTextChanged Event
Posted on: 03 Mar 2011  
using that code i am getting the following error,
why this this error comes, i used correct braces only

CS1026: ) expected

Re: How to call Java Script function in ASP.NET TextBox OnTextChanged Event
Posted on: 03 Mar 2011  
hi Honey
                You are asking that you need to check DOJ is not greater than DOB. In this case you cant check in OntextChanged Event because before fill the hole date how could you compare dates, so it cause error better you do this validation when you click submit button or any other control events but dont try to do in OnTextChanged Event.

I hope it may help you

Re: How to call Java Script function in ASP.NET TextBox OnTextChanged Event
Posted on: 07 Mar 2011  
If the query got resolved, then mark the post that helped you as Answer so will be helpful for others. Otherwise if you got the solution please share with us.
Mark as Answer, on the posts reply's that helped you !!!.

SPONSORED BY

Offshore Software and Database Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.