[QuickForm] My own validation
| From: | Cédric Fournier | Date: | Wed, 08 Dec 2004 13:08:47 +0000 |
| Subject: | [QuickForm] My own validation | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16111@lists.php.net to get a copy of this message | ||
Hello,
I try to add my own script validation on both client-side and server-side. I
Made this regular expression : and add with registerRule.
$form->registerRule('is_alpha_cr','regex',"/^[a-zA-Z'éèêëàâäùüûôöîïç,
-\n]+$/");
My regular expression looking for a string where there'is only letters,
blank and new line (\ n). My problem is that when i'm looking on the source
the newline disappear from my expression and there's a real new line. I had
an extra backslash. It works with Javascript but not with php because of the
extra backslashes.
Anybody have a solution to validate a text with regular expression ?
Thanks.