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.
This question is related to
javascript
jquery
html
HTML Date Picker You can refer this.
try to use jquery-ui
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
<script>
$(function() {
$( "#calendar" ).datepicker();
});
</script>
<p>Calendar: <input type="text" id="calendar" /></p>
jQuery Mobile has a datepicker too. Source
Just include the following files,
<script src="jQuery.ui.datepicker.js"></script>
<script src="jquery.ui.datepicker.mobile.js"></script>
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:
You will need to use any javascript html calendar widget.
try this calendar view widget, just copy-paste some code shown in example there and thats it what you want.
Here is the link to Jquery Mobile date box - JQM datebox
yeah you will come across of various issues using HTML5 datepicker, it would work with some or might not be. I faced the same issue. Please check this DatePicker Demo, I solved my problem with this plugin. Its very good and flexible datepicker plugin with complete demo. It is completely compatible with mobile browsers too and can be integrated with jquery mobile too.
What you need is a jQuery UI Datepicker
Check out the demo and the source code.
Starting with HTML5, <input type="date" />
will do just fine.
Source: Stackoverflow.com