Foxtrott has uploaded a new change for review. https://gerrit.wikimedia.org/r/116216
Change subject: Show error message when form is submitted with erroneous input ...................................................................... Show error message when form is submitted with erroneous input Change-Id: I4ccd795ecf71bae1d21f9122377f50b6c05fa039 --- M libs/datecheck.js M skins/SFI_DateCheck.css 2 files changed, 10 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticFormsInputs refs/changes/16/116216/1 diff --git a/libs/datecheck.js b/libs/datecheck.js index ab328b5..2440c2c 100644 --- a/libs/datecheck.js +++ b/libs/datecheck.js @@ -5,9 +5,14 @@ * */ -window.SFI_DateCheck_init = function ( input_id, params ) { - $.validate({ +window.SFI_DateCheck_init = function(input_id, params) { + $.validate({ borderColorOnError : '', // Border color of elements with invalid value; empty string to not change border color as it messes up the style of the input box - errorElementClass : 'form-error' // Class that will be put on elements with invalid value - }); + errorElementClass : 'form-error', // Class that will be put on elements with invalid value + onError: function() { + if (!document.getElementById("form_error_header")) { + jQuery("#contentSub").append('<div id="form_error_header" class="errorbox" style="font-size: medium"><img src="' + mw.config.get('sfgScriptPath') + '/skins/MW-Icon-AlertMark.png" /> ' + mw.message('sf_formerrors_header').escaped() + '</div>'); + } + } + }); }; diff --git a/skins/SFI_DateCheck.css b/skins/SFI_DateCheck.css index 9e9fcd7..69705bc 100644 --- a/skins/SFI_DateCheck.css +++ b/skins/SFI_DateCheck.css @@ -10,4 +10,5 @@ .form-error { color: #ff0000; + display: inline; } -- To view, visit https://gerrit.wikimedia.org/r/116216 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4ccd795ecf71bae1d21f9122377f50b6c05fa039 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SemanticFormsInputs Gerrit-Branch: master Gerrit-Owner: Foxtrott <s7ep...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits