I have an app that allows a user to enter certain dates about a candidate,
and not all dates are required. So, what is happening is, if someone enters
the Date Elected, and leaves the other two date fields blank, the date
1/1/1900 is entered by default. The form is a Flash Form and I am using the
CFINPUT Type=DateField tag. They look like this:
<cfinput type="datefield" name="DateElected" label="Date Elected"
width="100" value="#DateFormat(DateElected, "mm/dd/yyyy")#">
<cfinput type="datefield" name="AppointedDate" label="Date Appointed"
width="100" value="#DateFormat(DateAppointed, "mm/dd/yyyy")#">
<cfinput type="datefield" name="ResignDate" label="Date Resigned"
width="100" value="#dateFormat(ResignDate, "mm/dd/yyyy")#">
Neither of the three are required. So even if I do not enter a date into any
of these fields, I get the default 1/1/1900 entered. Here is the code that
enters the information:
<cfinvokeargument name="DateElected" value="#Form.DateElected#"/>
<cfinvokeargument name="AppointedDate" value="#Form.AppointedDate#"/>
<cfinvokeargument name="ResignDate" value="#Form.ResignDate#"/>
And here is a snipped from the CFC:
<cfargument name="DateElected" type="string" required="no" default="">
<cfargument name="DateAppointed" type="string" required="no" default="">
<cfargument name="ResignDate" type="string" required="no" default="">
and the query:
UPDATE tblCouncilMember
SET Fname = '#Arguments.Fname#',
Lname = '#Arguments.Lname#',
Address = '#Arguments.Address#',
City = '#Arguments.City#',
State = '#Arguments.State#',
Zip = '#Arguments.Zip#',
Phone = '#Arguments.Phone#',
Email = '#Arguments.Email#',
Status = '#Arguments.Status#',
NC_ID = #Arguments.NC_ID#,
IssuesOfConcern = '#Arguments.IssuesOfConcern#',
DateElected = '#Arguments.DateElected#',
DateAppointed = '#Arguments.AppointedDate#',
ResignDate = '#Arguments.ResignDate#',
TermLength = '#TermLength#'
WHERE CouncilMemberID =
#Arguments.CouncilMemberID#
Thanks,
--
Bruce Sorge
"I'm a mawg: half man, half dog. I'm my own best friend!"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267486
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4