This may be heresy to some folk, but you're probably better off doing this client side, if you are able. The Javascript in Version 4.x and above Netscape (and IE too, I think) has a regular expression engine built in. An re to match all possible valid email addrs could be quite large however: http://enterprise.ic.gc.ca/~jfriedl/regex/email-opt.txt Good luck, Bill -----Original Message----- From: Juergen Specht [mailto:specht@speed-link.de] Sent: Thursday, August 26, 1999 9:35 AM To: Andreas Kostyrka Cc: Zope List Subject: Re: [Zope] Validate fields? Andreas Kostyrka wrote:
how can i validate input fields in Zope? If somebody fills something in a input field and i expect an email-adress, how can i check the right syntax? Well, try this: <dtml-if "'@' in field"> GOOD Email address? </dtml-if> Mhm, but this is only a basic check that there is an @ in it. Everybody can use the following strings: @@ bla@bla @bla@ @
not so good...
I know how to do it in perl with regular expressions but in Well, somebody posted a patch or so to add the regular expression module functionality to the DTML namespace ;) Good idea, volunteers anywhere? :)
Juergen _______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope (To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )