I love plum and today I saw Adam post a reply on cftalk...maybe there is
hope for the world after all.

Has any one on the list (is any one still on the list?) used the regular
expression attribute of the validateinput tag?

I was trying to use a simple regex yesterday (disclaimer:  I don't really
understand regular expressions) and wasn't able to get it to work.  I was
trying to verify that the input had no special characters and no spaces.  I
tried a bunch of different combinations, but this is the one I most thought
should work.  [a-z0-9].

Whatever I tried, it either passed every input or failed every input,
irregardless of whether or not there were special characters or spaces.

Then I had this crazy idea that I should add quotes to the lines in the
validateinput tag that do the check as so...

Take the existing REFind:

<!--- Evaluate against a regular expression --->
                <cfif Len(Trim(Attributes.regularExpression))>
                        <cfif REFind(Attributes.regularExpression, 
Attributes.value) EQ 0>
                                <cfthrow type="Validation.InvalidData"
                                                
message="#Attributes.regularExpressionMessage#"
                                                errorCode="62200">
                        </cfif>
                </cfif>

And add some quotes:

<!--- Evaluate against a regular expression --->
                <cfif Len(Trim(Attributes.regularExpression))>
                        <cfif REFind("Attributes.regularExpression", 
Attributes.value) EQ 0>
                                <cfthrow type="Validation.InvalidData"
                                                
message="#Attributes.regularExpressionMessage#"
                                                errorCode="62200">
                        </cfif>
                </cfif>

But that didn't work either.



Any ideas?

Mark Fuqua



**********************************************************************
You can subscribe to and unsubscribe from lists, and you can change
your subscriptions between normal and digest modes here:

http://www.productivityenhancement.com/support/DiscussionListsForm.cfm
**********************************************************************

Reply via email to