How to validate a variable number of start and end dates on a web page using jQuery
<p>I am validating start date is less than end date using jquery.
It works if i know the no.of start and end date elements.
But my problem is in my form there can be many start and end dates.
How should i do it for example given below.</p>

<pre><code>Start Date &lt;input type="text" id="t1_sdate_0"&gt;
End date &lt;input type="text" id="t1_edate_0"&gt;  

Start Date &lt;input type="text" id="t1_sdate_1"&gt;
End date &lt;input type="text" id="t1_edate_1"&gt;


Start Date &lt;input type="text" id="t2_sdate_0"&gt;
End date &lt;input type="text" id="t2_edate_0"&gt;  

Start Date &lt;input type="text" id="t2_sdate_1"&gt;
End date &lt;input type="text" id="t2_edate_1"&gt;
</code></pre>

<p>I want to do something like below</p>

<pre><code>          $('#sDate').datepicker(
                {gotoCurrent: true, changeMonth: true, changeYear: true, dateFormat: 'dd-M-yy', yearRange: '1850:2050',maxDate:'0'
                ,
                 onSelect: function(selected) {
                    $("#eDate").datepicker("option","minDate", selected);
                }});

        $('#eDate').datepicker(
                {gotoCurrent: true, changeMonth: true, changeYear: true, dateFormat: 'dd-M-yy', yearRange: '1850:2050',maxDate:'0'
                ,
                 onSelect: function(selected) {
                    $("#sDate").datepicker("option","maxDate", selected);
                }});
</code></pre>
