>- see footer for list info -<
Another problem .... I am now doing some form checking ....

I want to ensure that the user doesn't enter a date in the future, that 
the field isn't blank, and that the date is valid ....

So I have .....



<!--- Validate the form fields. --->
<cfscript>
   // Initialize variables;
   ErrorMessage = "";
         DayPt = ListFirst(IncidentDate,"/");
 
   // IncidentDate.
   if (NOT Len(Trim(IncidentDate)) OR NOT IsDate(IncidentDate)) {
      ErrorMessage = ErrorMessage & "Please enter a valid Incident 
date.<br>";
   }
</cfscript>

<!---
<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)>
<cfswitch expression = #comparison#>
        <cfcase value = "-1">
                <!---<I>Date 1 is less than date 2</I>--->
        </cfcase>
        <cfcase value = "0">
                <!---<I>The dates are equal!</I>--->
        </cfcase>
        <cfcase value = "1">
                <cfset ErrorMessage = ErrorMessage & "You can not enter an 
incident in the future.<br>">
        </cfcase>
</cfswitch>
--->

The top bit I did in script and it works ok.
If I try the code underneath that works ok. If I put the two togethor it 
fails. If I put the code at the bottom in the script (in what I thin is 
script form) it fails ....

Can anyone help me with this please ...


Regards - Paul

***********************************************************************
The information contained within this e-mail (and any attachment) sent by 
Birmingham City Council is confidential and may be legally privileged. It is 
intended only for the named recipient or entity to whom it is addressed. If you 
are not the intended recipient please accept our apologies and notify the 
sender immediately, or telephone +(44) 121 464 4444 Unauthorised access, use, 
disclosure, storage or copying is not permitted and may be unlawful. Any e-mail 
including its content may be monitored and used by Birmingham City Council for 
reasons of security and for monitoring internal compliance with the office 
policy on staff use. E-mail blocking software may also be used. Any views or 
opinions presented are solely those of the originator and do not necessarily 
represent those of Birmingham City Council. We cannot guarantee that this 
message or any attachment is virus free or has not been intercepted and amended.
***********************************************************************
_______________________________________________

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