Search code examples
jquerypopupdatetimepicker

Jquery date time picker not working in popup window


Here is my case: I use jquery datetimepicker and it works fine in normal page but it's not working in popup-page. This is the date field:

<input type="text" name="date" id="date" />
  <script type="text/javascript">
     $(document).ready(function () {
        $( "#date" ).datepicker();
  });
  </script>

Here is the code: http://jsfiddle.net/nhonduyen/YqLk8/ You see the datetimepicker in body tag works, but when you click on contact -> schedule a meeting then a popup shows up, but the field datetimepicker doesn't work. Can you help me? Thank you. :)


Solution

  • You have use id='date' for more than one date field several times but id must be unique, So just change id='date' to class='date' and also in your JavaScript use:

    $(".date").datepicker();
    

    Instead of :

    $("#date").datepicker();
    

    It'll work (Working Example).