Re: QuickForm + "soft" rules.
| From: | Justin Patrin | Date: | Sun, 05 Jun 2005 21:17:59 +0000 |
| Subject: | Re: QuickForm + "soft" rules. | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19475@lists.php.net to get a copy of this message | ||
On 5/27/05, Justin Patrin <papercrane@gmail.com> wrote:
> On 5/27/05, Edward Grace <ej.grace@imperial.ac.uk> wrote:
> > 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.
> >
>
> Sounds like a great idea. In fact, it's a *little* like the
> preValidationCallback option I added to my SubForm element. I'll see
> if I can find a few minutes to see if I can hack something up.
>
Hmmm.....well my quick look didn't turn up anything easy. If anyone
else can get this working it would be great. Or a feature request for
QF would be good.
--
Justin Patrin