In html i want to show calendar to select date while clicking a text box. then we select a date from that calendar then the selected date will be display in that text box.
The <input type="date"> defines a date picker. The resulting value includes the year, month, and day. Tip: Always add the <label> tag for best accessibility practices!
getMonth() + 1; var year = todaydate. getFullYear(); var datestring = day + "/" + month + "/" + year; document. getElementById("frmDate"). value = datestring; } getDate();
Starting with HTML5, <input type="date" />
will do just fine.
Demo: http://jsfiddle.net/8N6KH/
You should read-up on jQueryUI Datepicker
Once you include the relevant jQuery UI library, it's as simple as,
Script:
$(function() {
$( "#datepicker" ).datepicker();
});
HTML:
<input type="text" id="datepicker" />
Pros:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With