PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm » Bug #1431

Feature Request: Tying rules/filters to submit buttons

Details

Submitted2004-05-18 15:01 UTC
Fromvasilyev at math dot uchicago dot edu
StatusWont fix
PackageHTML_QuickForm
PHP VersionIrrelevant
OSirrelevant
Roadmaps(Not assigned)

Comments

[2004-05-18 15:01 UTC] vasilyev at math dot uchicago dot edu

Description:
------------
It would be desirable to be able to bound rules and filters to submit buttons. For example, if the form has two submit buttons "Update" and "Remove", I would like to perform full validation if "Update" button was pressed, and perform no (or little) validation if "Remove" button was pressed.
Also, it would be nice to have a method QuickForm::isSubmitted() to see if the form was submitted (this is useful if there are several forms on one page with trackSubmit flag).

[2004-05-19 16:00 UTC] vasilyev at math dot uchicago dot edu

HTML_QuickForm_Controller allows binding actions to specific buttons. What I proposed was binding rules and filters to submit buttons. This is not as important for server side validation (because you can always check what button was pressed and perform needed validation) as it is for client side validation. Even multipage form created using HTML_QuickForm_Controller won't work as expected if you try to perform client side validation - then when you press Back button the form will be validated using JavaScript (while there should not be any validation done on Back button).
It would be nice to be able to at least exclude some submit buttons from client side validation. This will fix the above mentioned problem with HTML_QuickForm_Controller.

I agree with your remark on isSubmitted() method. However I still think that having such a method is a good idea - it will make the code more readable.