Last modified: 2013-11-20 22:58:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T42909, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40909 - Suppress native "invalid e-mail" warning on Special:ChangeEmail (since we do our own validation)
Suppress native "invalid e-mail" warning on Special:ChangeEmail (since we do ...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.21.x
All All
: Low minor (vote)
: 1.23.0 release
Assigned To: Theopolisme
https://en.wikipedia.org/wiki/Special...
gci2013
: easy, javascript
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-10 04:03 UTC by spage
Modified: 2013-11-20 22:58 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
browser tooltip and MediaWiki div both warning invalid email (167.95 KB, image/png)
2012-10-10 04:03 UTC, spage
Details

Description spage 2012-10-10 04:03:28 UTC
Created attachment 11173 [details]
browser tooltip and MediaWiki div both warning invalid email

With $wgHtml5 now true on en-wiki, the form field attribute type=email in MediaWiki forms flows to the browser.  This makes recent browsers validate e-mail addresses on submit.  Which is fine, except when the form does its own client-side validation, in which case two validation messages appear simultaneously.  See screenshot.

To reproduce, visit Special:ChangeEmail, enter a bad e-mail, tab out of the field, and click [Submit] or press the [Enter] key.

This may also happen with other forms using HTMl5 input types that trigger browser validation that do their own client-side validation.

A workaround is to disable the browser's validation with attributes novalidate and formnovalidate; it would be better to somehow cooperate with the browser's implementation.
Comment 1 Daniel Friesen 2012-10-10 05:56:28 UTC
You can bind a listener to the browser's native 'invalid' event. When you hear it you can output your own invalidity UI and then cancel the event. Canceling the event will not disable the validation (the form will still not submit) but it will disable the browser's native UI.
Comment 2 Richard Guk 2012-10-10 08:03:31 UTC
Bug 40585 is also caused by HTML5 form validation (input type="number" with step="any" stripped by Html::expandAttributes() prevents client submission of non-integer numbers).
Comment 3 Gerrit Notification Bot 2013-11-19 02:54:25 UTC
Change 96195 had a related patch set uploaded by Theopolisme:
Supress native "invalid email" warning on Special:ChangeEmail

https://gerrit.wikimedia.org/r/96195
Comment 4 Gerrit Notification Bot 2013-11-20 22:58:03 UTC
Change 96195 merged by jenkins-bot:
Supress native "invalid email" warning on Special:ChangeEmail

https://gerrit.wikimedia.org/r/96195
Comment 5 Bartosz Dziewoński 2013-11-20 22:58:18 UTC
Fixed by Theo as part of his GCI work. Thanks!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links