Click here to Skip to main content
14,391,598 members
Rate this:
Please Sign up or sign in to vote.
See more:
i am using datepicker and when i click on textbox not working

<!--calendar-->

 <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
 <script src="//code.jquery.com/jquery-1.10.2.js"></script>
 <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
 <link rel="stylesheet" href="/resources/demos/style.css">


 <script type="text/javascript">
$(function() {
  $( "#dob" ).datepicker({
    changeMonth: true,
    changeYear: true
  });
});
</script>


<input type="text" class="contacttxt" id="dob" name="dob"  placeholder="YYYY/MM/DD" value="" size="10" >
Posted
Updated 11-Dec-15 6:03am
v2

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 2

Perfectly works - [Demo] DatePicker ChangeMonth and ChangeYear Example[^].

Even I added the same code which you have added here and tested as a HTML. It is working. HTML is like below.
<html> 
<head>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
    <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
    <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css">

    <script type="text/javascript">
        $(function() {
            $( "#dob" ).datepicker({
                changeMonth: true,
                changeYear: true
            });
        });
    </script>
</head>
<body>
    <input type="text" id="dob" />
</body>
</html>
Comments
Harsh Kumar 11-Dec-15 9:52am
   
not working
error @ console

TypeError: $(...).datepicker is not a function
<anonymous>
contact-us.php:51
jQuery.Callbacks/fire()
jquery-1.10.2.js:3048
jQuery.Callbacks/self.fireWith()
jquery-1.10.2.js:3160
.ready()
jquery-1.10.2.js:433
completed()

and

ReferenceError: SyntaxHighlighter is not defined
<anonymous>
contact-us.php:184
m.Callbacks/j()
jquery.min.js:2
m.Callbacks/k.fireWith()
jquery.min.js:2
.ready()
jquery.min.js:2
J()
   
Did you test the html I provided? It is working.
Harsh Kumar 11-Dec-15 10:23am
   
independently code works but in my project file it not working
   
Then you have some other issue. Check on console if the jQuery files are included or not?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100