Re: HTML_QuickForm DHTML client rules and SoftRequired rule
| From: | Mark Wiesemann | Date: | Sun, 26 Mar 2006 13:47:25 +0000 |
| Subject: | Re: HTML_QuickForm DHTML client rules and SoftRequired rule | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-41985@lists.php.net to get a copy of this message | ||
Hi Justin,
> At the request of a user I've made a QuickForm class which alters the
> client rule system to display errors with each field, much like
> QuickForm's default renderer normally does upon submission.
Great idea and nice implementation. I've just tried it with one of my
projects using the QuickHtml renderer and it works as expected. Such
error message output is much useful than the normal alert window from
QF, especially if there are more than two or three errors in the form.
A nice addition to this would be the removal of '- ' before the error
message. The addition of '- ' makes sense in the alert window from QF
but not that much when showing the error messages above each field of
the form. I did not check where this is done in the QF code, but maybe
you have an (easy) idea how to get rid of '- '?
> I've also looked again into the idea of a SoftRequired rule which
> makes an error show up the first time a user tries to submit a field
> without a value, then goes away if the form is submitted again.
I also tried this and it worked also very well. In conjunction with AJAX
I can think of some real-world usage examples, like filling a field with
some "AJAX magic" when the field was left blank (e.g. a customer
number).
(Your argumentation about not using AJAX for more (server-side)
validation is valid, though.)
Regards,
Mark