The below coding shows the comparison of start and end date and shows error if end date is greater than start date
But what I want to do is how to write the same functionality in full PHP code I don't know. Could anybody help to write the below functionality in PHP coding
HTML
<input type="text" id="starddate" />
<input type="text" id="enddate" />
<div id="msg"></div>
<input type="submit" id="submit" />
JQuery
jQuery.validator.addMethod("greaterThan",
function(value, element, params) {
if (!/Invalid|NaN/.test(new Date(value))) {
return new Date(value) > new Date($(params).val());
}
return isNaN(value) && isNaN($(params).val())
|| (parseFloat(value) > parseFloat($(params).val()));
},'Must be greater than {0}.');
$("#enddate").rules('add', { greaterThan: "#startdate" });