Jquery UI Calendar with From and To

<div>
<label for="sdate">Traveling Start Date</label>
<input type="text" name="from" id="from">
</div>

<div class="clear"></div>

<div>
<label for="edate">Traveling End Date</label>
<input type="text" name="to" id="to">
</div>

<script>
$(function() {
var dates = $( "#from, #to" ).datepicker({
changeMonth: true,
numberOfMonths: 3,
onSelect: function( selectedDate ) {
var option = this.id == "from" ? "minDate" : "maxDate",
instance = $( this ).data( "datepicker" ),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings );
dates.not( this ).datepicker( "option", option, date );
}
});
});
</script>
<div>

0 Comments

You must be logged in to post a comment.