Hello I'm trying to create a simple textbox with a datepicker that appears when a user clicks inside of the it. I have the following loaded in my header:
<link rel="stylesheet" href="css/start/jquery-ui-1.8.13.custom.css">
<script src="js/jquery-1.5.1.min.js"></script>
<script src="js/jquery-ui-1.8.13.custom.min.js" type="text/javascript"> </script><!-- Was missing closing tag
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
And in my body, I have the following textbox:
<body>
<input id="datepicker" class="hasDatepicker" type="text">
</body>
My problem is that when I try to click inside the text box, nothing happens. I'm not sure what the problem might be. Any suggestions are appreciated.
UPDATE:
Tried the CDN and also downloaded the entire jQuery UI package and still won't show. Tried in both IE and Firefox.
UPDATE 2:
Was hoping that syntax error I corrected above would fix it, but no dice.
jQuery UI adds the "hasDatepicker" class to the input after it is clicked. Try removing the hasDatepicker class. If you are using a jQuery selector such as $('.hasDatepicker') to select the input(s), try giving it another class name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With