Page MenuHomePhabricator

HTMLForm should use <button> and allow differing value and label
Closed, ResolvedPublic

Description

Submit buttons, whether via HTMLForm::addButton() or HTMLSubmitField, are difficult to use effectively when the submitted value has to match the internationalized display label.

HTML5 (and HTML4 for that matter) already has <button> that does what we need, we just need to actually use it instead of <input type="submit">.

Event Timeline

Anomie created this task.Dec 15 2015, 10:23 PM
Anomie updated the task description. (Show Details)
Anomie raised the priority of this task from to Needs Triage.
Anomie claimed this task.
Anomie added a subscriber: Anomie.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 15 2015, 10:23 PM

Change 259410 had a related patch set uploaded (by Anomie):
HTMLForm: Use <button> and allow differing label and value

https://gerrit.wikimedia.org/r/259410

Tgr added a subscriber: Tgr.EditedDec 15 2015, 10:54 PM

Apparently the problem with <button> is that IE6 puts all button values into the POST data if the form was submitted through a button, and IE7 submits the content (inner text) of the tag instead of the value attribute :(

There are ugly JS hacks around this (e.g. this) but I could not find any workaround for IE 6/7 with JS disabled. Not sure how much we care about them but at least registration/login/edit should work. Maybe make <button> an option or an alternative control?

Damn IE... Although, it looks like the oojs version already isn't caring about it (it doesn't set useInputTag).

Change 259410 merged by jenkins-bot:
HTMLForm: Use <button> and allow differing label and value

https://gerrit.wikimedia.org/r/259410

Change 262340 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Fix tests failing because of HTMLForm change in core

https://gerrit.wikimedia.org/r/262340

Change 262340 merged by jenkins-bot:
Fix tests failing because of HTMLForm change in core

https://gerrit.wikimedia.org/r/262340

Anomie closed this task as Resolved.Jan 5 2016, 4:06 AM