very true
On 6/16/07, Alan Rother <[EMAIL PROTECTED]> wrote: > > Only one problem with this code > > <cfif isDefined("form.Year") and isDefined("form.Month") and isDefined(" > form.Day")> > <cfif IsDate(CreateDate(form.year,form.month,form.day))> > Date Valid > <cfelse> > Date is invalid > </cfif> > </cfif> > > > If the data entered into either of the three form fields is invalid, > the CreateDate will throw an error before the IsDate can do it's job. > > > It would be better to pull this out into a try catch > > <cftry> > <cfset variables.tempDate = CreateDate(form.year,form.month,form.day)> > > <cfcatch type="any"> > <cfset variables.dateError = true> > </cfcatch> > </cftry> > > > > > On 6/15/07, Andrew Scott <[EMAIL PROTECTED]> wrote: > > How about. > > > > <cfif isDefined("form.Year") and isDefined("form.Month") and isDefined(" > > form.Day")> > > <cfif IsDate(CreateDate(form.year,form.month,form.day))> > > Date Valid > > <cfelse> > > Date is invalid > > </cfif> > > </cfif> > > > > > > On 6/16/07, Robert Harrrison <[EMAIL PROTECTED]> wrote: > > > > > > I validate dates all the time, but in this case I have to combine > three > > > separate fields and validate if the date is valid. > > > > > > code is: > > > > > > <cfif IsDate(form.day/form.month/form.year) is false> > > > BAD DATE > > > </cfif> > > > > > > Anyone see what's wrong here. It's not validating. > > > > > > > > > > > > > > > > > > Robert B. Harrison > > > Director of Interactive services > > > Austin & Williams > > > 125 Kennedy Drive, Suite 100 Hauppauge NY 11788 > > > T : 631.231.6600 Ext. 119 > > > F : 631.434.7022 > > > www.austin-williams.com > > > > > > Great advertising can't be either/or... It must be &. > > > > > > > > > No virus found in this outgoing message. > > > Checked by AVG Free Edition. > > > Version: 7.5.472 / Virus Database: 269.8.17/850 - Release Date: > 6/15/2007 > > > 11:31 AM > > > > > > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion MX7 and Flex 2 Build sales & marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281356 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4