Mike, Change your '>' sign in your if DateDiff line to 'gt' and I bet it will work. Tom
________________________________
From: [EMAIL PROTECTED] on behalf of Mike Sumner
Sent: Thu 8/24/2006 9:53 AM
To: 'Dallas/Fort Worth ColdFusion User Group Mailing List'
Subject: [DFW CFUG] a little date difference
I am using a flash form and I want to check if a date selected is greater than
30 days from now. I can check it on the action page, but I would like to check
it after they select the date. I have tried to use examples from AS Fusion but
just can't seem to get the syntax correct. The form will not load.
<cfsavecontent variable="checkShipDate">
var shipdate = shipdate.text;
if (DateDiff('D',Now(),shipdate) > 30)
{
alert("Your Ship Date is more than 30 days from now. Please choose a date
within 30 day or resubmit at a later time.", "Warning",
mx.controls.Alert.OK );
}
</cfsavecontent>--->
the name of the form is myform
here is the cfinput <cfinput type="datefield" name="shipdate"
width="125" label="Ship Date" tooltip="Choose Date" mask="YYYY-MM-DD"
onChange="#checkShipDate#" >
as a bonus if I could stop them from proceeding until they choose a date less
than 30 away would be great not just a warning box. I will check for that at
the action page.
Thanks in advance for any suggestions.
Mike Sumner
<<winmail.dat>>
_______________________________________________ Reply to DFWCFUG: [email protected] Subscribe/Unsubscribe: http://lists1.safesecureweb.com/mailman/listinfo/list List Archives: http://www.mail-archive.com/list%40list.dfwcfug.org/ http://www.mail-archive.com/list%40dfwcfug.org/ DFWCFUG Sponsors: www.HostMySite.com www.teksystems.com/
