HTML Calendar Input Form with jQuery
I want to use HTML text form input with calendar, and I found the way in this article.
That requires jQuery libraries links. Here is a procedure.
- Adding following lines in HTML header section.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/i18n/jquery.ui.datepicker-ja.min.js"></script> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/redmond/jquery-ui.css" /> <script> $(function() { $("#datepicker").datepicker(); }); </script>
- Using following text box in the same html, we can use calendar input.
<input type="text" id="datepicker" name="StartDate" />
The most simple way is using a following input element, but it doesn't work in my HTML, maybe I declare XHTML 1.0. According to other sites, input type date is likely supported on HTML5.
<input type="date" name="StartDate" />
But I can use calendar input with jQuery even if the HTML is declared as XHTML 1.0.