Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi am a newbie here in asp.net developing
I have a requirement where I am supposed to have two textboxes t1,t2

where the first t1 I select a date through date picker. and when selecting the second date it has to be within 90 days period of the first date. beyond 90 days either the calendar could be blocked or flash an error message.

I have tried in javascript but the +90 days seems to only take the current or todays date in the textbox1 where as I want it to take any specific date selected by the user in t1.

please help me.
Thanks
Ashwin
Posted
Comments
Maciej Los 23-Dec-14 1:52am    
What have you tried? Where are you stuck?
Member 11279441 23-Dec-14 1:55am    
this is what I have done

<script type="text/javascript">
$(function () {
$("[id$=txtOnDate]").datepicker({
useMode: 3,
dateFormat: "d-M-yy",
firstDay: '1',
onSelect: function (dateStr) {
$('#txtAppDate').datepicker('option', 'defaultDate', dateStr);
$('#txtAppDate').datepicker('option', 'minDate', dateStr);
}
});
});
</script>
<script type="text/javascript">
$(function (){
$("[id$=txtAppDate]").datepicker({
useMode: 3,
dateFormat: "d-M-yy",
firstDay: '1',
maxDate: "+60D",
});
});
</script>


the above code takes only the current date or todays date into account. but I want it to take a specific date that the user selects

Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900