JqueryUI - Populate an alternate field with its own date format whenever a date is selected using the altField and altFormat


SUBMITTED BY: jlolk3r

DATE: Feb. 15, 2016, 9:13 a.m.

FORMAT: HTML

SIZE: 722 Bytes

HITS: 1150

  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>jQuery UI Datepicker - Populate alternate field</title>
  6. <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  7. <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  8. <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  9. <link rel="stylesheet" href="/resources/demos/style.css">
  10. <script>
  11. $(function() {
  12. $( "#datepicker" ).datepicker({
  13. altField: "#alternate",
  14. altFormat: "DD, d MM, yy"
  15. });
  16. });
  17. </script>
  18. </head>
  19. <body>
  20. <p>Date: <input type="text" id="datepicker">&nbsp;<input type="text" id="alternate" size="30"></p>
  21. </body>
  22. </html>

comments powered by Disqus