> On Fri, 28 Jan 2005 14:24:29 -0500, S. Isaac Dealey
> <[EMAIL PROTECTED]> wrote:
>> (nearly OO) approach to development. Lets say that I
>> develop an
>> application that I sell to someone and they don't like
>> the way my
>> forms are written / presented -- they want to add or
>> remove fields.

> But adding / removing fields is going to reflect changes
> to the
> database and the business processing within the app so,
> frankly, the
> form tag is the least of your worries...

Not necessarily, it depends on your intent. If you're removing the
form field because it represents a feature of the application which
you don't intend to use then there's no reason (that I can think of)
that you couldn't simply remove the input element and allow the
application to use its default values. In which case, the form may be
your only worry, much less the least of. Similarly if you're adding a
field, you would then presumably also be adding code on the back-end
to handle that field.

>> Just did. The answer is actually still "no". By automatic
>> validation
>> I'm not referring to having an attribute in the tag which
>> allows you
>> to specify how a field is validated -- I'm talking about
>> validating a
>> field to a given type _without_ specifying the type.

> But databases don't contain phone numbers, email addresses
> and social security numbers as types so you can't deduce
> that sort of validation anyway.

No, that's why the form features have additional validation tags and
attributes for these types of values and provides an API for creating
custom validators. However -- the majority of form validation will
fall into one of three categories -- numeric, date and
character-length. All three of these types of validation can be
assumed from the database's meta-data, so as long as the data is
available. Why force yourself to do more work to validate these things
if it's not necessary?

The end result of them not being validated automatically is that in
many (most?) applications I've seen, they are never validated, they
simply produce a ColdFusion error when someone enters a value the
database won't accept. So the automated validation is capable of
handling the bulk of the validation work (with a single attribute no
less), and the handfull of occasional remaining validation types
(phone numbers, email addresses, http url's, etc) can be handled
independently.

Phone numbers in particular vary wildly from one locale to the next as
do postal addresses, which makes validating them a potentially large
i18n headache, and for what(?) if a user enters an invalid value it's
no better or worse in the case of a phone number than a value not
provided.

>> <tap:validate type="required">
>>   <input name="offerprice" />
>>   <input name="availabledate" />
>> </tap:validate>
>>
>> the <tap:validate> tag allows you to indicate that all
>> contained input
>> elements are required at one time without needing to
>> specify
>> validation for each input element individually.

> Ah, then the answer is yes I believe and I think Tim or
> Ben even demo'd this functionality...

Cool.

>> Going back to the previous question about needing the
>> context of the
>> cfform tag for cfinput elements -- if I've sold an
>> application to
>> someone who decides they don't want to use a form field
>> which is
>> required by default, they can remove the required input
>> element
>> without affecting the form's validation (and without
>> editing a single
>> character of my code) -- that is, the form only validates
>> what it
>> contains at the time it is validated.

> Seems to me that's how CF's validation works - if you
> remove the
> required input element, the automatic validation will no
> longer
> require that field to be present (since the validation is
> derived from
> the fields themselves rather than the form per se).

So that's comparable, cool.

s. isaac dealey     954.927.5117
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://macromedia.breezecentral.com/p49777853/
http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
http://www.fusiontap.com


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192174
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to