HTMLForm: Allow distinguishing between form views and submission attempts
authorBartosz Dziewoński <matma.rex@gmail.com>
Mon, 30 May 2016 21:11:33 +0000 (23:11 +0200)
committerFlorianschmidtwelzow <florian.schmidt.stargatewissen@gmail.com>
Fri, 22 Jul 2016 18:00:15 +0000 (18:00 +0000)
commitb5237cfc1b4757527648381f57f6cc23882a9afe
treea4b9a7c96994cab920ac2ee3df17ddbead5bbb7f
parent0f6f4abbd10fa68af27f06e1a6f75d9aa786a2b6
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
includes/htmlform/HTMLCheckField.php
includes/htmlform/HTMLCheckMatrix.php
includes/htmlform/HTMLForm.php
includes/htmlform/HTMLFormField.php
includes/htmlform/HTMLMultiSelectField.php