Add `datetimepicker` to form


I have a form where i would like to add a datetimepicker().
I must be doing something wrong.

I have done the following:
In my header.php

<?php wp_enqueue_script("jquery"); ?>

In my functions.php

wp_enqueue_style('jquery-style', '');

In my template.php

<form id="" name="" action="<?php echo get_permalink(); ?>" method="post">
    <input type="text" id="MyDate" name="MyDate" value=""/>
    <input type="submit" value="Submit" name="submit">
<script type="text/javascript">
    jQuery(document).ready(function() {
            dateFormat : 'dd-mm-yy'

Here is the error:

Uncaught TypeError: jQuery(...).datepicker is not a function

I see the <input> element but if I click in it nothing happens.
This all comes from the following link

Hope anyone sees my mistake(s)!

, , , Interactive 5 years 0 Answers 85 views 0

Leave an answer