[drupal-docs] Forms API quick start

Larry Garfield larry at garfieldtech.com
Sat Oct 22 20:26:04 UTC 2005


On Saturday 22 October 2005 07:25 am, Dries Buytaert wrote:

> 2. It would saved me some grepping if the quickstart showed me how to
> validate a URL, e-mail address or integer value.  Form validation is
> an important step; having some additional examples would be _really_
> useful.

I've had virtually nothing to do with the new form API yet, but very often 
validation is as simple as "does it meet this format?"  Phone numbers, email 
addresses, integers, ZIP codes, URLs...  Is it too late in the development 
cycle to have a "#validate" field for a form element where you specify a 
PCRE, and then the API automatically flags it invalid if the text doesn't 
match?  That would save a lot of duplicated simple Regex validator calls.

-- 
Larry Garfield			AIM: LOLG42
larry at garfieldtech.com		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson



More information about the drupal-docs mailing list