I need to check two textfields for possible user date input. Such input is only meaningful if they have first selected a date field, from a select list, to search from which is called $dates.
So I have:
Code: Select all
if((validDate($dateFrom) == 0) || (validDate($dateTo) == 0) && ($dates == "Please select a date field to search on"))
{
$errors = 1;
$table .=
"
<table width='100%' border='0' cellpadding='1'>
<tr>
<td class='warning'><div align='center'>ERROR! - Please select a date field to search on</div></td>
</tr>
</table>
";
}
If either of the date validations returns zero and $dates == "Please select a date field to search on" then generate the html error message.