JQuery: Datepicker - Defining mindate and maxdate dynamically from dropdown selection
Hello, please help.
I want to dynamically define my mindate and maxdate based from the dropdown selection with the selected date as the maxdate creating 2-week range.
Example: If I selected 12/22/2012 from the dropdown, I should be able to select multiple dates in the range from 12/09/2012 to 12/22/2012, something like below:
Here's my HTML code:
<select id="dropdown" name="dropdown">
<option value="11/24/2012">11/24/2012
<option value="12/08/2012">12/08/2012
<option value="12/22/2012">12/22/2012
<option value="01/05/2013">01/05/2013
</select>
<input type="text" id="start_date" name="xdate" readonly>
<script>
$('#start_date').multiDatesPicker({
minDate: new Date(2012, 12 -1, 09),
maxDate: new Date(2012, 12 -1, 22)
});
</script>