[Zope] How to check if a string contains some characters??

David Burton eloquence@eloquent-designs.f2s.com
Mon, 12 Mar 2001 17:31:44 -0000


A better idea would normally to try to handle invalid values before it
reaches ZOPE.
Something like this is usually best handled by Javascript verification.

You can take this too far (one form page given to us by a design company had
well over 100K of Javascript validation text), but if the system is going to
be handled over the web, using Javascript is a lot faster than detecting
this server-side. It saves on the server hits too.

Save the server validation for checking for duplicate entries, etc.

If you need a sample of validating a form like this, let me know.

Yours,
David Burton

----- Original Message -----
From: "Marcello Lupo" <lupo@icmnet.net>
To: <zope@zope.org>
Sent: Monday, March 12, 2001 11:59 AM
Subject: [Zope] How to check if a string contains some characters??


> Sorry to bother you,
> Is there a simple way to check if a string contain only this values:
> "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.-_"
> and otherwise raise an error?
> Thank you in advice,
> Marcello
>
>
> --
> ----------------------------------------
> Marcello Lupo            Project Manager
>                Atis Srl
>           Via dell'Artigliere 2
>       37014 Castelnuovo del Garda (VR)
> Tel. +39-0457570960 - Fax +39-0457571268
>        E-mail: lupo@atisworld.com
>         http://www.atisworld.com
> -----------------------------------------
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )