[dev] UI widget for verifying e-mails

Chuck Hagenbuch chuck at horde.org
Wed Dec 21 19:50:25 PST 2005


Quoting Dilyan Palauzov <Dilyan.Palauzov at aegee.org>:

> 	As enough users do not manage to enter valid e-mail in the from_addr
> preference, I tought about creating a new widget of the type 'special',
> which verifies if the entered address is for sure invalid. However, the
> same widget could be applied also for the replyto_addr, so maybe
> creating a new kind of UI-widgets, called 'e-mail' would be a better
> solution.

How about using Horde_Form for the prefs forms instead, and if  
necessary adding further email validation rules to the existing  
Horde_Form_Type_email field.

> 	Right now I consider that the idea can be generalized, so that a new
> widget is introduced, called e.g. regext, which matches the entered data
> for validy towards a regular expression.

You know that the regex for matching a valid email address is several  
_pages_ long, right?

> 	2. Shall the verifying be done at server side (using php) or client
> side (using javascript)? Of course php is the better option, but I
> couldn't find currently any easy possibilities to verify the data on the
> server side (please contradict me), so I suggest that initially the
> checking is done via JavaScript (and later both methods are used - once
> for users without javascript support, once for getting fast responce
> when entering data).

Never just do server-side validation if you're going to bother  
validating at all.

Also, what do you see that you can do in javascript that you can't do in PHP?

-chuck

-- 
"So we're talking near-sonic speeds for a vegetable."
Reasons to go to the Punkin Chunkin World Championships


More information about the dev mailing list