- see footer for list info -<
Cracked it ...!

Just needed a little sleep I think .....

<!--- Validate the form fields in case JavaScript validation failed. --->
<cfscript>
  // Initialize variables;
  ErrorMessage = "";
         Todays_Date = lsdateformat(now(), "dd/mm/yyyy");


         //Check the Incident date delimeters.
//if there aren't exactly 3 elements in this list assuming the delimiter is "/", it fails
         IF (NOT ListLen(IncidentDate, "/") EQ 3){
ErrorMessage = ErrorMessage & "The Incident Date has an invalid delimeter. - dd/mm/yyyy<br>";
  }

  // IncidentDate.
  if (NOT Len(Trim(IncidentDate)) OR NOT IsDate(IncidentDate)) {
ErrorMessage = ErrorMessage & "The Incident date is invalid. - dd/mm/yyyy<br>";
  }

         // The incident can't be in the future.

if (IsDate(IncidentDate) AND DateCompare(IncidentDate, Todays_Date) EQ 1) { ErrorMessage = ErrorMessage & "You can not record an incident in the future!.<br>";
  }

</cfscript>


_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
- Hosting provided by www.cfmxhosting.co.uk -<
- Forum provided by www.fusetalk.com -<
- DHTML Menus provided by www.APYCOM.com -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to