[ACFUG Discuss] weird cfinput vs input stuff. date is shown as {d '2009-02-12'} vs 02/12/2009

2009-02-12 Thread Ajas Mohammed
Hi,

I noticed this in my form submission and dont know why cfinput with
validation would show date as *{d '2009-02-12'} *whereas regular input would
show same value as* 02/12/2009* . See code below :

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/ or
MM-DD-.

input type=text name=absence_date_txtbox_#thisrow# size=10 value=

/cfloop

so in this form, i entered 02/12/2009 in both the textboxes and i get weird
output.

Any ideas??? I am I missing something obvious here???


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.


Re: [ACFUG Discuss] weird cfinput vs input stuff. date is shown as {d '2009-02-12'} vs 02/12/2009

2009-02-12 Thread Ajas Mohammed
Thanks,

Yes, but the big question is why cffrom cfinput would send date in that
format. Its not the first time I have i used cfinput. Date usually comes
across in standard date format.

Anyone???

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 10:15 AM, Dawn Hoagland dawnhoagl...@gmail.comwrote:

 Do a dateformat(formfield,'mm/dd/') before using the data from the
 form.


 On Thu, Feb 12, 2009 at 9:41 AM, Ajas Mohammed ajash...@gmail.com wrote:

 Hi,

 I noticed this in my form submission and dont know why cfinput with
 validation would show date as *{d '2009-02-12'} *whereas regular input
 would show same value as* 02/12/2009* . See code below :

 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/ or
 MM-DD-.

 input type=text name=absence_date_txtbox_#thisrow# size=10
 value=

 /cfloop

 so in this form, i entered 02/12/2009 in both the textboxes and i get
 weird output.

 Any ideas??? I am I missing something obvious here???


 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.





Re: [ACFUG Discuss] weird cfinput vs input stuff. date is shown as {d '2009-02-12'} vs 02/12/2009

2009-02-12 Thread Teddy R. Payne
Ajas,
This is my unconfirmed assertion.  You have a validator type of type date,
which returns a string expression of a date object notation.  My assertion
is that the validator type that you use will give you the data type on the
submission in its expressed format.

I changed your code to validate using a regular expression and I received
the original data text as regular expression are strings and do not have an
alternate expression of their data type.

The regex that I used, which may not be eprfect is:

(0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d

Teddy


Re: [ACFUG Discuss] weird cfinput vs input stuff. date is shown as {d '2009-02-12'} vs 02/12/2009

2009-02-12 Thread Dean H. Saxe

Please tell me you mistyped perfect on purpose.

Please.

-dhs


Dean H. Saxe, CISSP, CEH
d...@fullfrontalnerdity.com
I have always strenuously supported the right of every man to his own  
opinion, however different that opinion might be to mine. He who  
denies another this right makes a slave of himself to his present  
opinion, because he precludes himself the right of changing it.

-- Thomas Paine, 1783


On Feb 12, 2009, at 10:23 AM, Teddy R. Payne wrote:


Ajas,
This is my unconfirmed assertion.  You have a validator type of type  
date, which returns a string expression of a date object  
notation.  My assertion is that the validator type that you use will  
give you the data type on the submission in its expressed format.


I changed your code to validate using a regular expression and I  
received the original data text as regular expression are strings  
and do not have an alternate expression of their data type.


The regex that I used, which may not be eprfect is:

(0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d

Teddy




-
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
-





Re: [ACFUG Discuss] weird cfinput vs input stuff. date is shown as {d '2009-02-12'} vs 02/12/2009

2009-02-12 Thread shawn gorrell
oyu stll no wut he ment... ;)





From: Dean H. Saxe d...@fullfrontalnerdity.com
To: discussion@acfug.org
Sent: Thursday, February 12, 2009 10:41:36 AM
Subject: Re: [ACFUG Discuss] weird cfinput vs input stuff. date is shown as {d  
'2009-02-12'} vs 02/12/2009

Please tell me you mistyped perfect on purpose.

Please.

-dhs


Dean H. Saxe, CISSP, CEH
d...@fullfrontalnerdity.com
I have always strenuously supported the right of every man to his own opinion, 
however different that opinion might be to mine. He who denies another this 
right makes a slave of himself to his present opinion, because he precludes 
himself the right of changing it.
-- Thomas Paine, 1783


On Feb 12, 2009, at 10:23 AM, Teddy R. Payne wrote:

 Ajas,
 This is my unconfirmed assertion.  You have a validator type of type date, 
 which returns a string expression of a date object notation.  My assertion is 
 that the validator type that you use will give you the data type on the 
 submission in its expressed format.
 
 I changed your code to validate using a regular expression and I received the 
 original data text as regular expression are strings and do not have an 
 alternate expression of their data type.
 
 The regex that I used, which may not be eprfect is:
 
 (0?[1-9]|1[012])[- /.](0?[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d
 
 Teddy



-
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
-


-
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
-



Re: [ACFUG Discuss] weird cfinput vs input stuff. date is shown as {d '2009-02-12'} vs 02/12/2009

2009-02-12 Thread Dawn Hoagland
As a matter of habit, I do not use the cfinput tags for validation however
the few times I've reviewed or modified code from other developers who
validate dates this way, this is the behavior I have seen.

In general, when I'm checking the date on the submit, I format it
anyway.

On Thu, Feb 12, 2009 at 10:22 AM, Ajas Mohammed ajash...@gmail.com wrote:

 Thanks,

 Yes, but the big question is why cffrom cfinput would send date in that
 format. Its not the first time I have i used cfinput. Date usually comes
 across in standard date format.

 Anyone???

 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 10:15 AM, Dawn Hoagland dawnhoagl...@gmail.comwrote:

 Do a dateformat(formfield,'mm/dd/') before using the data from the
 form.


 On Thu, Feb 12, 2009 at 9:41 AM, Ajas Mohammed ajash...@gmail.comwrote:

 Hi,

 I noticed this in my form submission and dont know why cfinput with
 validation would show date as *{d '2009-02-12'} *whereas regular input
 would show same value as* 02/12/2009* . See code below :

 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/ or
 MM-DD-.

 input type=text name=absence_date_txtbox_#thisrow# size=10
 value=

 /cfloop

 so in this form, i entered 02/12/2009 in both the textboxes and i get
 weird output.

 Any ideas??? I am I missing something obvious here???


 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.






Re: [ACFUG Discuss] weird cfinput vs input stuff. date is shown as {d '2009-02-12'} vs 02/12/2009

2009-02-12 Thread Teddy R. Payne
Ajas,
I recommend reading the Adobe Live Docs concerning validation and form
fields.  In the below snippet, you will see some curious behavior:


cfparam name=form.test default= /

cfdump var=#form#

cfform name=foo action=untitled2.cfm

cfinput type=text name=absence_date_1 size=10 value= validate=
date validateat=onBlur message=You have entered an invalid date. Date's
should be in this format MM/DD/ or MM-DD-.

cfinput type=text name=absence_date_2 size=10 value= validate=
date validateat=onSubmit message=You have entered an invalid date.
Date's should be in this format MM/DD/ or MM-DD-.

cfinput type=text name=absence_date_3 size=10 value= validate=
date validateat=onServer message=You have entered an invalid date.
Date's should be in this format MM/DD/ or MM-DD-.

cfinput name=submit type=submit value=submit

/cfform

What you will see is that the data will return a string for OnBlur and
OnSubmit validation types, but OnServer is giving you the data expression
format.  According to LiveDocs, the validation schema for each data type
varies based upon your validate choice du jour.

Snippet from Live Docs:
 Validation differences The preceding table describes the general validation
behavior. The underlying validation code must differ depending on the
validation method and the form type. As a result, the algorithms used vary
in some instances, including the following:

   - The validation algorithms used for date/time values varies between
   onSubmit/OnBlur and OnServer.
   - The algorithms used for onSubmit/OnBlur validation in Flash vary from
   those used for HTML/XML format, and generally follow simpler rules.

The table describes the onSubmit/OnBlur behavior in HTML format. For
detailed information on the OnServer validation algorithms, see Data
validation types
http://livedocs.adobe.com/coldfusion/8/htmldocs/validateData_05.html#1176140in
Data validation types
http://livedocs.adobe.com/coldfusion/8/htmldocs/validateData_05.html#1176140in
the *ColdFusion Developer's Guide*.

For more information on validation, including discussions of the advantages
and disadvantages of different validation types, see Validating Data
http://livedocs.adobe.com/coldfusion/8/htmldocs/validateData_01.html#1096836in
the *ColdFusion Developer's Guide*.


Re: [ACFUG Discuss] weird cfinput vs input stuff. date is shown as {d '2009-02-12'} vs 02/12/2009

2009-02-12 Thread Dean H. Saxe
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


Dean H. Saxe, CISSP, CEH
d...@fullfrontalnerdity.com
If liberty means anything at all, it means the right to tell people  
what they do not want to hear.

-- George Orwell, 1945



On Feb 12, 2009, at 10:50 AM, Dawn Hoagland wrote:

As a matter of habit, I do not use the cfinput tags for validation  
however the few times I've reviewed or modified code from other  
developers who validate dates this way, this is the behavior I have  
seen.


In general, when I'm checking the date on the submit, I format it  
anyway.


On Thu, Feb 12, 2009 at 10:22 AM, Ajas Mohammed ajash...@gmail.com  
wrote:

Thanks,

Yes, but the big question is why cffrom cfinput would send date in  
that format. Its not the first time I have i used cfinput. Date  
usually comes across in standard date format.


Anyone???

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 10:15 AM, Dawn Hoagland dawnhoagl...@gmail.com 
 wrote:
Do a dateformat(formfield,'mm/dd/') before using the data from  
the form.



On Thu, Feb 12, 2009 at 9:41 AM, Ajas Mohammed ajash...@gmail.com  
wrote:

Hi,

I noticed this in my form submission and dont know why cfinput with  
validation would show date as {d '2009-02-12'} whereas regular input  
would show same value as 02/12/2009 . See code below :


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/ 
 or MM-DD-.


input type=text name=absence_date_txtbox_#thisrow# size=10  
value=


/cfloop

so in this form, i entered 02/12/2009 in both the textboxes and i  
get weird output.


Any ideas??? I am I missing something obvious here???


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.








-
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
-





RE: [ACFUG Discuss] weird cfinput vs input stuff. date is shown as {d '2009-02-12'} vs 02/12/2009

2009-02-12 Thread Charlie Arehart
Thanks for all that, and fair enough. I missed the looping that was
appending more to the field name, but the info may still help someone. 

 

And indeed what you've confirmed is what I would have said if you'd stopped
at your first paragraph: the onserver validation is causing CF to create the
hidden field (albeit in a new format, different from the old style _date
kind-check out the HTML source generated to see it), and that new hidden
field name is still clearly causing CF to continue to do the conversion to
odbc dateformat. 

 

I'll grant it's as annoying now as the old approach was then,  but at least
what you tried confirmed things. 

 

You could raise the concern to Adobe to say, hey, it's cool and all that
your server-side validation (old or new approach) can validate dates, but
why convert it also to odbc date format?

 

/charlie

 

From: ad...@acfug.org [mailto:ad...@acfug.org] On Behalf Of Ajas Mohammed
Sent: Thursday, February 12, 2009 12:22 PM
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

 

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.



 




-
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
-



Re: [ACFUG Discuss] weird cfinput vs input stuff. date is shown as {d '2009-02-12'} vs 02/12/2009

2009-02-12 Thread Dean H. Saxe
Yes Charlie, but the server side is dependent upon receiving a flag  
from the client to tell the server what to validate, if I recall  
correctly.  So effectively, it is still client-side validation.


-dhs


Dean H. Saxe, CISSP, CEH
d...@fullfrontalnerdity.com
I have always strenuously supported the right of every man to his own  
opinion, however different that opinion might be to mine. He who  
denies another this right makes a slave of himself to his present  
opinion, because he precludes himself the right of changing it.

-- Thomas Paine, 1783


On Feb 12, 2009, at 11:39 AM, Charlie Arehart 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
-







-
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
-





Re: [ACFUG Discuss] weird cfinput vs input stuff. date is shown as {d '2009-02-12'} vs 02/12/2009

2009-02-12 Thread Dawn Hoagland
And this is why I never use it unless the user has their knickers in a wad
to know about the error before they go to the next page.  Even then I
usually don't bother (especially if they are on an intranet) because the
server validation is so quick they don't realize that they've just *gasp*
submitted the form and received clear, concise error messages without the
developer writing reams of JavaScript code (which users can - and will
disable) since I have to check it on the server anyway.  If they ask, I just
tell them that clicking the submit button triggers the validation code.
Well - it does :)

Now Flex is a whole 'nother can of worms and many times I validate the
second the user changes the value or focus.

Dawn

On Thu, Feb 12, 2009 at 1:16 PM, Charlie Arehart char...@carehart.orgwrote:

  Thanks for all that, and fair enough. I missed the looping that was
 appending more to the field name, but the info may still help someone.



 And indeed what you've confirmed is what I would have said if you'd stopped
 at your first paragraph: the onserver validation is causing CF to create the
 hidden field (albeit in a new format, different from the old style _date
 kind—check out the HTML source generated to see it), and that new hidden
 field name is still clearly causing CF to continue to do the conversion to
 odbc dateformat.



 I'll grant it's as annoying now as the old approach was then,  but at least
 what you tried confirmed things.



 You could raise the concern to Adobe to say, hey, it's cool and all that
 your server-side validation (old or new approach) can validate dates, but
 why convert it also to odbc date format?



 /charlie



 *From:* ad...@acfug.org [mailto:ad...@acfug.org] *On Behalf Of *Ajas
 Mohammed
 *Sent:* Thursday, February 12, 2009 12:22 PM
 *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



 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.



 -
 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 FusionLink http://www.fusionlink.com
 -


Re: [ACFUG Discuss] weird cfinput vs input stuff. date is shown as {d '2009-02-12'} vs 02/12/2009

2009-02-12 Thread Teddy R. Payne
What of the AJAX approach to validation?  You can pass the form to a server
side object for validation.  Take the CF8 feature of cfajaxproxy.

Obviously, you can turn of JavaScript. As well as a client initiated
validation would not solely suffice.

Teddy R. Payne, ACCFD
Google Talk - teddyrpa...@gmail.com



On Thu, Feb 12, 2009 at 2:00 PM, Dawn Hoagland dawnhoagl...@gmail.comwrote:

 And this is why I never use it unless the user has their knickers in a
 wad to know about the error before they go to the next page.  Even then I
 usually don't bother (especially if they are on an intranet) because the
 server validation is so quick they don't realize that they've just *gasp*
 submitted the form and received clear, concise error messages without the
 developer writing reams of JavaScript code (which users can - and will
 disable) since I have to check it on the server anyway.  If they ask, I just
 tell them that clicking the submit button triggers the validation code.
 Well - it does :)

 Now Flex is a whole 'nother can of worms and many times I validate the
 second the user changes the value or focus.

 Dawn


 On Thu, Feb 12, 2009 at 1:16 PM, Charlie Arehart char...@carehart.orgwrote:

  Thanks for all that, and fair enough. I missed the looping that was
 appending more to the field name, but the info may still help someone.



 And indeed what you've confirmed is what I would have said if you'd
 stopped at your first paragraph: the onserver validation is causing CF to
 create the hidden field (albeit in a new format, different from the old
 style _date kind—check out the HTML source generated to see it), and that
 new hidden field name is still clearly causing CF to continue to do the
 conversion to odbc dateformat.



 I'll grant it's as annoying now as the old approach was then,  but at
 least what you tried confirmed things.



 You could raise the concern to Adobe to say, hey, it's cool and all that
 your server-side validation (old or new approach) can validate dates, but
 why convert it also to odbc date format?



 /charlie



 *From:* ad...@acfug.org [mailto:ad...@acfug.org] *On Behalf Of *Ajas
 Mohammed
 *Sent:* Thursday, February 12, 2009 12:22 PM
 *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



 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.



 -
 To unsubscribe from this list, manage your profile @
 http://www.acfug.org?fa=login.edituserformhttp://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 FusionLink http://www.fusionlink.com/
 -