]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - resources/src/mediawiki/htmlform/htmlform.js
MediaWiki 1.30.2
[autoinstalls/mediawiki.git] / resources / src / mediawiki / htmlform / htmlform.js
1 ( function ( mw, $ ) {
2
3         $( function () {
4                 mw.hook( 'htmlform.enhance' ).fire( $( document ) );
5         } );
6
7         mw.hook( 'htmlform.enhance' ).add( function ( $root ) {
8                 // Turn HTML5 form validation back on, in cases where it was disabled server-side (see
9                 // HTMLForm::needsJSForHtml5FormValidation()) because we need extra logic implemented in JS to
10                 // validate correctly. Currently, this is only used for forms containing fields with 'hide-if'.
11                 $root.find( '.mw-htmlform' ).removeAttr( 'novalidate' );
12         } );
13
14 }( mediaWiki, jQuery ) );