> then to concatenate them before writing to the DB would be easiest.
I've done this, too. If you use drop-down selects for each of the
fields your formatting woes are pretty much over. Your formatting is
gauranteed since you are specifying the inputs yourself when you code
the app.
Your validation is then a reasonably simple case statement that makes
sure of stuff like the user didn't pick June 31st, or Feb 29 if its
not a leap year. The example below resets the date to an allowable
max, but you can do whatever you like.
<cfswitch _expression_="#form.TopicMonth#">
<cfcase value="01,03,05,07,08,10,12">
<cfif form.TopicDay GT 31><cfset form.TopicDay="31"></cfif>
</cfcase>
<cfcase value="04,06,09,11">
<cfif form.TopicDay GT 30><cfset form.TopicDay="30"></cfif>
</cfcase>
<cfcase value="02">
<cfif IsLeapYear(form.TopicYear)>
<cfif form.TopicDay GT 28><cfset form.TopicDay="28"></cfif>
<cfelse>
<cfif form.TopicDay GT 29><cfset form.TopicDay="29"></cfif>
</cfif>
</cfcase>
</cfswitch>
--
--Matt Robertson--
MSB Designs, Inc.
mysecretbase.com
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

