HomePhabricator

HTMLForm: Allow distinguishing between form views and submission attempts

Authored by matmarex on May 30 2016, 9:11 PM.

Description

HTMLForm: Allow distinguishing between form views and submission attempts

Calling HTMLForm::setFormIdentifier() will set an internal identifier
for this form. It will be submitted as a hidden form field, allowing
HTMLForm to determine whether the form was submitted (or just viewed).
Setting this serves two purposes:

  • If you use two or more forms on one page, it allows HTMLForm to identify which of the forms was submitted, and not attempt to validate the other ones. (T102114)
  • If you use checkbox or multiselect fields inside a form using the GET method, it allows HTMLForm to distinguish between the initial page view and a form submission with all checkboxes or select options unchecked. (T29676)

Bug: T102114
Bug: T29676
Change-Id: Ib6ce3fd8941be86211cff5c6932b5e84982490fa