X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki%2Fhtmlform%2Fhtmlform.js;h=bc835b5924ab8424efc3c73c09c111350875c64e;hb=0b6930c6216313d3ddf521b07516b539a5f92113;hp=19f8f3ece5eb124109a65597c49da558e90ec8eb;hpb=adae996840b9e782f6e14b21c433a83e37c3a74e;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/mediawiki/htmlform/htmlform.js b/resources/src/mediawiki/htmlform/htmlform.js index 19f8f3ece5..bc835b5924 100644 --- a/resources/src/mediawiki/htmlform/htmlform.js +++ b/resources/src/mediawiki/htmlform/htmlform.js @@ -4,4 +4,11 @@ mw.hook( 'htmlform.enhance' ).fire( $( document ) ); } ); + mw.hook( 'htmlform.enhance' ).add( function ( $root ) { + // Turn HTML5 form validation back on, in cases where it was disabled server-side (see + // HTMLForm::needsJSForHtml5FormValidation()) because we need extra logic implemented in JS to + // validate correctly. Currently, this is only used for forms containing fields with 'hide-if'. + $root.find( '.mw-htmlform' ).removeAttr( 'novalidate' ); + } ); + }( mediaWiki, jQuery ) );