Click here to Skip to main content
15,911,459 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In one of my ASP.Net project, the jQuery's datePicker function is used well. In another project, I use the same code, but the jQuery function is not fired at all when I click the textbox for a date. What is possible reason that blocks to fire the jQuery function? Appreciate if you can share your experience.
Posted
Comments
Kornfeld Eliyahu Peter 27-Mar-14 8:01am    
You may look into your browser console (debug) and see if you got some error that preventing jQuery UI to load...
[no name] 27-Mar-14 8:10am    
Thanks for your hint. I added a line: debugger; in the function into my 2 project. In one of the projects, it went through but another one, I got: Microsoft JScript runtime error: Object doesn't support this property or method when it hits
$('#tbTest').datepicker({ dateFormat: 'mm/dd/yy' });
Any additional hint to dig out the cause? Thanks.
Kornfeld Eliyahu Peter 27-Mar-14 8:13am    
It seems jQuery UI doesn't loaded. maybe jQuery itself too.
Two things:
1. While in debugging go to the browser's console and look for errors...
2. Let us see your code...
[no name] 27-Mar-14 8:55am    
You are right! I added
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.0.2/jquery-ui.min.js" type="text/javascript"></script>
It works now. Please re-post your answer and then your response is to be credited. Thanks.
Ankur Ramanuj 27-Mar-14 8:06am    
can saw me a code here?

It seems - according to OP's comments - that jQuery UI or jQuery (or both!) does not loaded with the page.
The best solution is to go and debug the the page - all modern browsers can tell you if there was an error while loading some JavaScript. If there is no error, you may go over the list of loaded JavaScript - if your's missing add it at the header of your page...
 
Share this answer
 
check if the id of the control is not getting changed!! major reason
 
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