I want to show calender when user click on input field,
can some one tell me why this script doesn’t execute ?
<input type="text" id="dob"/>
here is the script
$("#dob").click(function(){
alert("here");
$("#dob").datepicker();
});
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to call
$("#dob").datepicker();when the page loads, not when you click on the input box. When you call.datepicker()when the page loads, JQuery will automatically assign all the relevant event handlers to the input box to show the picker. So do this in your JQuery instead: