Ok got an issue, i'm trying to work out how to validate a form/datobject, i have a start date for a task and an end date for the task, what i want to do is on the edit task form if the FinDate field is populated that it checks that the value is not less than the StartDate.
I've tried,
if(isset($_POST['FinDate'])) {
if($_POST['FinDate'] < $_POST['StartDate']) {
$form->addErrorMessage('FinDate', 'End Date cannot be fore start date', 'bad');
return $this->redirectBack();
}
}
but this just keeps firing when no date is added and if a date is added it doesn't validate.
Any help or pointers much appreciated.
Mick