- see footer for list info -<
Thanks Michael,
The line that seems to cause the error is this one ....
MthPt = ListGetAt(IncidentDate,2,"/");
Every time I add this it falls over ....
<!--- Validate the form fields in case JavaScript validation failed. --->
<cfscript>
// Initialize variables;
ErrorMessage = "";
DayPt = ListFirst(IncidentDate,"/");
MthPt = ListGetAt(IncidentDate,2,"/");
// IncidentDate.
if (NOT Len(Trim(IncidentDate)) OR NOT IsDate(IncidentDate)) {
ErrorMessage = ErrorMessage & "Please enter a valid Incident
date.<br>";
}
</cfscript>
From: "Michael Traher" <[EMAIL PROTECTED]>
Reply-To: Coldfusion Development <[email protected]>
To: "Coldfusion Development" <[email protected]>
Subject: Re: [CF-Dev] This is driving me nuts .....
Date: Wed, 22 Mar 2006 23:30:32 +0000
>- see footer for list info -<
Can you post the code in cfscript style and the error produced please?
No need for ## around variables within cf tags unless they are in quotes
So
<cfset DayPt = ListFirst("#IncidentDate#","/")>
or
<cfset DayPt = ListFirst(IncidentDate,"/")>
the second is preferable as it is cleaner.
But that is not causing a problem, its just an observation.
For this section
<cfset DayPt = ListFirst(#IncidentDate#,"/")>
<cfset MthPt = ListGetAt(#IncidentDate#,2,"/"
>
> )>
> <cfset YrPt = ListLast (#IncidentDate#,"/")>
> <cfset DateTime = (CreateDate(YrPt, MthPt, DayPt))>
> <cfset todays_date = lsdateformat(now(), "dd/mm/yyyy")>
> <cfset comparison = DateCompare(DateTime, Todays_Date)>
>
I would do
<!--- do the basic len and isdate check then --->
<cfset myIncidentDate = LSParseDateTime(IncidentDate)>
<cfset comparison = dateCompare(myIncidentDate,now())>
<cfif comparison NEQ 1>
handle future error here
</cfif>
--
Mike T
Blog http://www.socialpoints.com/
_______________________________________________
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
-<
_______________________________________________
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 -<