I've got 3 date fields on a form, each is set using the standard datetimepicker.js, however I have set the resulting text field to readonly to prevent users entering silly date formats into the field.
However the 3 fields must be in the correct order i.e. datetime1 must be before datetime2 and datetime2 must be before datetime3
The datefields are defined as below
<span style='white-space:nowrap'><input style="background:#fff" readonly id='readytime' name='readytime' type='text' size='15' value='<?php echo date("d-m-Y H:i"); ?>'><a href="javascript:NewCal('readytime','ddmmyyyy',true,24)"><img src='images/cal.gif' width='16' height='16' border='0' alt='Pick a date'></a></span><br>
Can anybody suggest a way of checking the dates whenever one changes onchange appears not to work on a readonly field??
Also what the best way to compare date strings (in a britsh format dd-mm-yyyy hh:mm) in javascript?