I know. The experssion im using is not that complicated and I just cut and pasted it. I don't know enough about RegExes to even know what it is really doing. I was just perplexed that for as often it comes up of needing to make sure that the email address is properly formatted that there is not something built in. Did you know that the pattern attribute does not even come up in the code hints?
 
Adaryl "Did you reboot?" Wakefield
Aviator by passion
Programmer by sheer force of will
----- Original Message -----
Sent: Thursday, April 15, 2004 9:52 AM
Subject: RE: [KCFusion] validate

They do in the form of regular expressions.
Here's the example for email addresses
Validating an E-Mail Address
Want to add an e-mail validation? You can do that, too. It's as easy as specifying that the validation will be using regular expressions (using VALIDATE="regular_expression") and then offering the _expression_ in a new PATTERN attribute. Here's an example that will validate e-mail addresses:

<CFFORM ACTION="">
Email: <CFINPUT TYPE="Text" NAME="email"
VALIDATE="regular_expression"
PATTERN=" ^([_a-z0-9-]+(\.[_a-z0-9-]+)[EMAIL PROTECTED](\.[a-z0-9-]+)*\.
(([a-z]{2,3})|(aero|coop|info|museum|name)))?$"
MESSAGE="Email is improperly formatted">
<INPUT TYPE="Submit">
</CFFORM>

That regular _expression_ in the PATTERN attribute may seem quite daunting. For now, just accept that regular expressions that do something useful may exist - and the cool thing is you can copy them from others to get the benefit.

This is from http://www.sys-con.com/coldfusion/articleprint.cfm?id=379

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Adaryl Wakefield
Sent: Wednesday, April 14, 2004 2:58 PM
To: [EMAIL PROTECTED]
Subject: [KCFusion] validate

Anybody else find this strange that this does not exist
 
<cfinput type="text" validate="email">
 
Adaryl "Did you reboot?" Wakefield
Aviator by passion
Programmer by sheer force of will

Reply via email to