QuickForm + "soft" rules.
| From: | Edward Grace | Date: | Fri, 27 May 2005 08:48:07 +0000 |
| Subject: | QuickForm + "soft" rules. | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-19382@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Has anyone else come across the need to add "soft" (rules that the user can
choose to override) validation rules to QuickForm objects?
What I mean by this is a typical scenario where you may have a rule that
checks that a person has entered their name according to some case formatting
so for example.
Surname
Rather than
sURnaMe
There are however situations where the case formatting of a surname could not
fit into the typical box of "capital first letter, the rest lowercase" hence
not being able to use a filter rule. For example the surnames
van Blogger
al Tranger
McTaggert
Clearly break this "convention". Of course one could add exceptions for
"van", "al" "Mc" prefixes but you still can't guarentee catching
them all
with a "strong" validation rule.
What would be useful is to have a soft validation rule whereby, if it fails
the usual message appears along with a checkbox saying "Yes I really want to
submit this" that would override the associated rule.
This can be done with some hacking about using groups, rules etc but it would
be nice to have a addSoftRule() method, or some such that would generate the
appropriate elements if the validation failed, and deal with overriding the
rule if the checkbox is set.
Have people looked at this before? I imagine it is a common want.
- -ed
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFClt7Q+i4TdNhCMrYRAq7qAJ9Ird36hvhz/LnH8gtuWKZyvJFEVwCgqJsD
dOClJ/cem4dOvT5gd8wYvt4=
=7mvS
-----END PGP SIGNATURE-----