views:

42

answers:

1

I have used JqueryUI plugin- date picker to display my date. The format is such that it has Fromdate & Todate. If I select fromDate: for example 09/28/2010 and If I select toDate: for example 09/30/2010. It should be like this such that todate is always the one which comes after the fromdate.

But i want to validate such that if I click toDate that is from previous month or the day before fromDate the validation should not allow me to select a date which is previous that of fromDate.

My Jscript is

    <script type="text/javascript">
$(document).ready(function() {
    $('.fromDate').datepicker({clickInput:true});
            $('.toDate').datepicker({clickInput:true});
});
    </script>

My html is

 <tr><td>Enter FromDate:</td><td><input type="text" id="fromDate" class="fromDate"
 readonly /></td></tr>

Enter ToDate:

How to do that. Any suggestions Please.

+1  A: 

You can use a custom validation method for jQuery Validate for that. See this answer here on SO.

FreekOne