At 09:11 PM 01/20/2002 -0500, you wrote:
>I have a form field defaulted to Today's date (as mm/dd/yyyy).  The user can
>change it to some future date, if they so wish.
>
>On my processing page, I need to run a statement which, if the date from the
>form is not today's date, then
>a different template is displayed.  The code below I what I'm using now, but
>I get an error that CF can't determine the value of todayDate =
>DateValue(Now()).  How do I write the correct syntax?

  My first impulse is to try something like this:

<cfif Now() is form.dateofsend>
   <CFLOCATION URL="e_main.cfm" ADDTOKEN="No">
<cfelse>
  other logic
</cfif>

  You could also try something like this (not sure if it will work):

<cfif (form.dateofsend-Now()) is 0>   <!--- alternate condition: not 
(form.dateofsend-now()) -->
   <CFLOCATION URL="e_main.cfm" ADDTOKEN="No">
<cfelse>
  other logic
</cfif>

  Or you could look into the DateDiff function to see if it will work.


You may also want to use the IsDate function, just to make sure your form 
is passing a valid date:

<cfif IsDate(Form.dateofsend)>
    Doh, this is probably why I'm having an error.
<cfelse>
    other logic
</cfif>


   And... well, this should give you a few things to look at.



>---------------
><cfset todayDate = DateValue(Now())
>
><cfif not todayDate(form.dateofsend)>
>         <CFLOCATION URL="e_main.cfm" ADDTOKEN="No">
><cfelse>
>.... Other logic
></cfif>
>
>---------------




--
Jeffry Houser | mailto:[EMAIL PROTECTED]
AIM: Reboog711  | ICQ: 5246969 | Fax / Phone: 860-223-7946
--
DotComIt: Database Driven Web Data
My Book: Instant ColdFusion 5  | http://www.instantcoldfusion.com
My New Book: ColdFusion: A Beginner's Guide February 2002
--
Far Cry Fly, Alternative Folk Rock
http://www.farcryfly.com | http://www.mp3.com/FarCryFly
______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to