I'm trying to add a datepicker widget to my form on Drupal.
I've a page with the following code:
<script>
$(function() {
$( "#datepicker" ).datepicker({
changeMonth: true,
changeYear: true
});
});
</script>
<form action="/scripts/new-customer.php">
<div>Birth date: <input type="text" id="datepicker" name="bday" /></div>
</form>
But unfortunately I get the error in the subject. I tried to write as follows:
<script>
(function($) {
$( "#datepicker" ).datepicker({
changeMonth: true,
changeYear: true
});
})(jQuery);
</script>
But I got the same error the line after.
Unfortunately, I cannot get any further with Drupal documentation.