How to use more than one date picker on a page

user2300933

I am trying to add two date pickers to my form, but can not get even one picker to display correctly. Here is the code I found. Thanks for any help.

<script type="text/javascript">
    $('.datetime').datetimepicker({
        dateFormat: 'yy-mm-dd',
        timeFormat: 'h:m'
    });
</script> 

Here is my HTML

<tr>
  <td><input type="text" name="expiration_date" class="" id="datepicker[0]" /></td>
  <td><input type="text" name="action_date" class="" id="datepicker[1]" /></td>
</tr>

Im am new to javascript so thank you for your help.

James

That's because your selector i.e. $('.datetime') is looking for all elements with a datetime class set (of which you have none). All your input's all have class="", for this to work you need to change these to class="datetime" i.e.

<input type="text" name="expiration_date" class="datetime" id="datepicker[0]" />
<input type="text" name="action_date" class="datetime" id="datepicker[1]" />

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

how to use a date picker more than once?

From Dev

how to use more than one validation in one page

From Dev

How to use componentsSeparatedByString with more than one

From Dev

How to use more than one shader program?

From Dev

How to create more than one index page in Ruby on Rails

From Dev

How to Print more than one page in C#

From Dev

how to put isActive for More than one page in angularjs

From Dev

How to include a PHP page more than once one with a curl

From Dev

how to put isActive for More than one page in angularjs

From Dev

How to use variables when using more than one "use db"

From Dev

configuring more than one {{> uploader}} in one page

From Dev

How to use more than one parameter set in Cucumber for test automation?

From Dev

how to use more than one foreign key in mapping django models

From Dev

How to use more than one verb when starting a process?

From Dev

How to use jQuery :not selector for more than one element at a time

From Dev

How to use more than one query in Pentaho Report Designer?

From Dev

How can I use ScriptManager more than one function?

From Dev

how to use more than one string in like expression in sql

From Dev

How to use eql? with more than one argument in Ruby?

From Dev

How to use more than one verb when starting a process?

From Dev

How to use more than one query in Pentaho Report Designer?

From Dev

How do I use more than one fxml with javaFX?

From Dev

How to use fscanf to obtain numbers with more than one delimiter?

From Dev

How to use mappedBy with more than one value JPA

From Dev

How to use more than one Component type (Embedded, Embeddable) in annotation

From Dev

How to use netcat to check ports on more than one remote server?

From Dev

How To Use Key Authentication With More Than One User

From Dev

mvc use more than one form in one page filtered with the selection of radio Button

From Dev

Django more than one ListView to an html page

Related Related

  1. 1

    how to use a date picker more than once?

  2. 2

    how to use more than one validation in one page

  3. 3

    How to use componentsSeparatedByString with more than one

  4. 4

    How to use more than one shader program?

  5. 5

    How to create more than one index page in Ruby on Rails

  6. 6

    How to Print more than one page in C#

  7. 7

    how to put isActive for More than one page in angularjs

  8. 8

    How to include a PHP page more than once one with a curl

  9. 9

    how to put isActive for More than one page in angularjs

  10. 10

    How to use variables when using more than one "use db"

  11. 11

    configuring more than one {{> uploader}} in one page

  12. 12

    How to use more than one parameter set in Cucumber for test automation?

  13. 13

    how to use more than one foreign key in mapping django models

  14. 14

    How to use more than one verb when starting a process?

  15. 15

    How to use jQuery :not selector for more than one element at a time

  16. 16

    How to use more than one query in Pentaho Report Designer?

  17. 17

    How can I use ScriptManager more than one function?

  18. 18

    how to use more than one string in like expression in sql

  19. 19

    How to use eql? with more than one argument in Ruby?

  20. 20

    How to use more than one verb when starting a process?

  21. 21

    How to use more than one query in Pentaho Report Designer?

  22. 22

    How do I use more than one fxml with javaFX?

  23. 23

    How to use fscanf to obtain numbers with more than one delimiter?

  24. 24

    How to use mappedBy with more than one value JPA

  25. 25

    How to use more than one Component type (Embedded, Embeddable) in annotation

  26. 26

    How to use netcat to check ports on more than one remote server?

  27. 27

    How To Use Key Authentication With More Than One User

  28. 28

    mvc use more than one form in one page filtered with the selection of radio Button

  29. 29

    Django more than one ListView to an html page

HotTag

Archive