> Long time ago, I found form field suffix with _date
> would be ignored/unrecognized by CF5.0 either using
> regular FORM submit or CFFORM submit. I may be caused
> by the CFFORM's date type validation and unwittingly
> extended to FORM as well.
> I let it slip for guessing other people would come
> cross it as well and report it, then, Macromedia would
> issue a patch to fix it.  So far, I'ven't heard of
> such a patch.
> 
> No workaround, some database column ends with _date,
> e.g. OrderEntry_Date, which is totally normal and
> common, and one is not supposed to change a given
> database's structure, some one argues that a column
> name should not contain "_" (underscore), I think
> that's nonsense, it does not break any normalization
> rules.
> 
> Folks, correct me, if I'm wrong.

This isn't a bug, and doesn't have anything to do with CFFORM validation.
Within any HTML form, there are some reserved suffixes for use with CF's
built-in server-side validation rules. The suffix "_date" is one of them. If
you name a form field  "dob" (for "date of birth"), say, and you want to
enforce the entry of only date values, you could add a hidden form to your
field called "dob_date":

Date of Birth: <input type="text" name="dob">
<input type="hidden" name="dob_date" value="You must enter a valid date for
date of birth!">
<input type="hidden" name="dob_required" value="You must enter your date of
birth!">

So, again, this isn't a bug. If you design a database schema for use with a
CF application, you may want to avoid the use of field names that end with
"_date" or any of the other six validation rule suffixes. Or, if you're
determined to use those field names, you simply have to deal with it in your
SQL statements:

<cfquery name="UpdStuff" ...>
        UPDATE mytable
        SET    OrderEntry_Date = <cfqueryparam value="#Form.OrderEntryDate#"
..>
        WHERE  ...
</cfquery>

I'm pretty sure this is listed somewhere within the documentation, as well.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to