very true
On 6/16/07, Alan Rother <[EMAIL PROTECTED]> wrote:
>
> Only one problem with this code
>
> form.Day")>
>
> Date Valid
>
> Date is invalid
>
>
>
>
> 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
Only one problem with this code
Date Valid
Date is invalid
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
How about.
Date Valid
Date is invalid
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:
>
>
>BAD DATE
>
>
> Anyone see what's wr
quotation marks and pound signs?
- Original Message
From: Robert Harrrison <[EMAIL PROTECTED]>
To: CF-Talk
Sent: Friday, June 15, 2007 1:09:32 PM
Subject: Stupid Date Question
I validate dates all the time, but in this case I have to combine three
separate fields and validate if the dat
Did not test it but I think this would work:
IsDate("#Form.day#/#form.Month#/#Form.Year#")
May need to switch the placement of the day and the month. I personally
would use a CreateDate function either within the IsDate function or on a
variable that is then used in the IsDate function.
On 6/1
Your code tells CF that Day is divided by Month is divided by Year.
Use the createDate() function first. You can wrap a try/catch around
it. If CF can't create a valid date from your input, then isDate() will
throw a catachable exception.
Or use isDate(form.day & "/" & form.month & "/" & form.y
6 matches
Mail list logo