Hi, i have some input fields like below:
<input type="text" name="date_1" class="dataList" value="2009-12-30" />
<input type="text" name="date_2" class="dataList" value="2007-06-12" />
<input type="text" name="date_3" class="dataList" value="2009-10-23" />
<input type="text" name="date_max" class="result" value="0000-00-00" />
I must to do something like this:
1) Add to array list of dates from all input fields with attribute class="dataList" (fields contain date in format yyyy-mm-dd)
2) Check that all fields are full and check if all dates are in good format(month not more than 12, day not maore than 31, lenght of all qual 10 chars)
3A) If conditions from second point are true then:
-sort the array from max to min value
-get the first element from array and set it to value of input with name="data_max"
3B) If conditions from second point are false then:
-get "0000-00-00" and set it to value of input with name="data_max"
I done all this things in PHP, but i want to do this in jQuery.
In jQuery i can update in real time the value of data_max field.
Please give me some suggestions what functions i should to use.
Regards, Pit