Hi Charlie,

Thanks for pointing out _date validation. That would make sense. But if you
notice, from the code, I use a loop and I am *appending* the index number
variable #thisrow# to the end of the cfinput absence_date#this_row#. So
technically, CF should not have done the _date validation as you
mentioned     Ajas, what you're being tripped up by is the fact that you're
using a suffix of  _date for your input field.
My take is that, this is not the case.

So I tried this just for fun "The solution is to change the field (as you've
created, absence_date) to use some other name, like absence-date, for
instance, or absencedate." and still I get {d '2009-02-12'}. Please read
below for full details.

<cfinput type="text" name="*absencedate*#thisrow#" size="10" value=""
validate="date" validateat="onBlur,onSubmit,onServer" message="You have
entered an invalid date. Date's should be in this format MM/DD/YYYY or
MM-DD-YYYY.">

So, now code looks like this


<cfloop from="1" to="10" index="thisrow">

<cfinput type="text" name="absence_date#thisrow#" size="10" value=""
validate="date" validateat="onBlur,onSubmit,onServer" message="You have
entered an invalid date. Date's should be in this format MM/DD/YYYY or
MM-DD-YYYY.">

<cfinput type="text" name="*absencedate*#thisrow#" size="10" value=""
validate="date" validateat="onBlur,onSubmit,onServer" message="You have
entered an invalid date. Date's should be in this format MM/DD/YYYY or
MM-DD-YYYY.">

<cfinput type="text" name="absence_date_onBlur#thisrow#" size="10" value=""
validate="date" validateat="onBlur"  message="You have entered an invalid
date. Date's should be in this format MM/DD/YYYY or MM-DD-YYYY.">
<cfinput type="text" name="absence_date_onSubmit#thisrow#" size="10"
value="" validate="date" validateat="onSubmit"  message="You have entered an
invalid date. Date's should be in this format MM/DD/YYYY or MM-DD-YYYY.">
<cfinput type="text" name="absence_date_onSRVR#thisrow#" size="10" value=""
validate="date" validateat="onServer"  message="You have entered an invalid
date. Date's should be in this format MM/DD/YYYY or MM-DD-YYYY.">

<input type="text" name="absence_date_txtbox_#thisrow#" size="10" value="">

</cfloop>

So
absence_date1 gives {d '2009-02-12'} with validateAt set to all the 3.

*absencedate1 *gives {d '2009-02-12'} with validateAt set to all the 3.

absence_date_onBlur1 gives 02/12/2009 with validateAt set to onBlur.

absence_date_onSubmit1 gives 02/12/2009 with validateAt set to onSubmit.

absence_date_*onSRVR1 *gives {d '2009-02-12'} with validateAt set to *
onServer*.

absence_date_txtbox_1 gives 02/12/2009 i.e. the regular input type textbox.

So, as Teddy mentioned, I tried his code and indeed, when I had
validateAt="onServer", I am getting date in the format {d '2009-02-12'} ,
which I dont really need.

I just wanted to try out all options so everyone knows what it is all about
and what is happening at different occasions for different options.

Not meant to go at Charlie.Your suggestions are always very helpful mate. In
fact, I picked this validateAT from you ;-).

Thanks all,


<Ajas Mohammed />
http://ajashadi.blogspot.com
We cannot become what we need to be, remaining what we are.
No matter what, find a way. Because thats what winners do.
You can't improve what you don't measure.
Quality is never an accident; it is always the result of high intention,
sincere effort, intelligent direction and skillful execution; it represents
the wise choice of many alternatives.


On Thu, Feb 12, 2009 at 11:39 AM, Charlie Arehart <char...@carehart.org>wrote:

> Just to be clear, Ajas's use of validateat="onblur,onsubmit,onserver" does
> in fact do both client- and server-side validation, but no doubt the whole
> subject of validation (client and server-side) is indeed important and
> deserves careful scrutiny from a security perspective.
>
> On a separate topic, I realize some don't like CF's validation (not saying
> this is Dean's issue here) and CFForm in general, but some may find that
> it's improved quite a bit over the years and has things they never realized
> (and which have nothing to do with Flash or Java).
>
> To that end, check out the 2-page article I did in my backpage column of
> the
> FAQU back in late 2007, which lists 11 bullet points highlighting those
> features:
>
> Tipical Charlie: CFFORM: Are You Sure You Want to Ignore It?
> http://www.carehart.org/articles/faqu_4_tips_cfform.pdf
>
> Hope that's helpful.
>
> /charlie
>
> -----Original Message-----
> From: ad...@acfug.org [mailto:ad...@acfug.org] On Behalf Of Dean H. Saxe
> Sent: Thursday, February 12, 2009 11:08 AM
> To: discussion@acfug.org
> Subject: Re: [ACFUG Discuss] weird cfinput vs input stuff. date is shown as
> {d '2009-02-12'} vs 02/12/2009
>
> Plus its a completely useless client side check which needs to be
> repeated server-side as well if you want any assurance that validation
> was successful.
>
> -dhs
>
>
>
> -------------------------------------------------------------
> To unsubscribe from this list, manage your profile @
> http://www.acfug.org?fa=login.edituserform
>
> For more info, see http://www.acfug.org/mailinglists
> Archive @ http://www.mail-archive.com/discussion%40acfug.org/
> List hosted by http://www.fusionlink.com
> -------------------------------------------------------------
>
>
>
>

Reply via email to