Groups | Blog | Home
all groups > coldfusion flash integration > april 2005 >

coldfusion flash integration : CFFORM validations using regular expressions


khoj
4/27/2005 12:00:00 AM
has anyone tried to do CFForm validations using regular expressions.
the simple one i tried is for alphanumeric characters.
it does not seem to work.

It validates all the predifened validate types like zip,email etc..
but i want to do a custom validation.

any help will be appreciated.
Thanks.


IowaDave
4/27/2005 12:00:00 AM
I'm running into the same problem. The following code works fine when
format=html, but doesn't work at all when format=flash:

<cfinput
type="text"
name="Month"
label="Month:"
validate="regular_expression"
pattern="([0-9]{2,})"
message="You must enter two digits!"
required="yes"
width="75"
maxlength="2">

I was so impressed with the new flash form until this. Anyone have an idea
what we might be doing wrong?

Thanks also,
Dave
tzimmerman
4/28/2005 12:00:00 AM
Regular expressions don't work with Flash format. The following is from the
validation types documentation regarding regex or regular_expression oo cfinput:

Matches input against the pattern attribute. Valid in HTML and XML format
only; ignored in Flash format.


http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/
wwhelp.htm?context=ColdFusion_Documentation&file=00000279.htm

Ted Zimmerman
khoj
4/28/2005 12:00:00 AM
Thanks Ted,
I almost did not read that part of the documentation.
However, i got it working.

validateat=",onServer"
validate="regular_expression"
pattern="<some custom expression>"

this is not the best solution for onsubmit handling.

IowaDave
4/28/2005 12:00:00 AM
I wanted to throw my thanks in, also, esp. for sending the link. I lost a
couple hours on that one. Thing is, I read my documentation. I'm using
Forta's latest web application construction kit. It seems as though he forgot
to add that last part. If you look in Table B.81, you'll see the part about
not working in flash is missing.

Dave
AddThis Social Bookmark Button