|
5 | 5 | * Documentation and issue tracking on Github <https://github.com/victorjonsson/jQuery-Form-Validator/> |
6 | 6 | * |
7 | 7 | * @license Dual licensed under the MIT or GPL Version 2 licenses |
8 | | -* @version 1.9.36 |
| 8 | +* @version 1.9.37 |
9 | 9 | */ |
10 | 10 | (function($) { |
11 | 11 |
|
|
109 | 109 | $element |
110 | 110 | .removeClass(config.errorElementClass) |
111 | 111 | .parent() |
112 | | - .find('.jquery_form_error_message').remove(); |
| 112 | + .find('.'+config.errorMessageClass).remove(); |
113 | 113 |
|
114 | 114 | // if element has custom err msg container, clear it |
115 | 115 | if( elementErrMsgObj != null) { |
|
143 | 143 | if( elementErrMsgObj != null) { |
144 | 144 | elementErrMsgObj.innerHTML = validation; |
145 | 145 | } else { // use regular span append |
146 | | - $element.parent().append('<span class="jquery_form_error_message">'+validation+'</span>'); |
| 146 | + $element.parent().append('<span class="'+config.errorMessageClass+'">'+validation+'</span>'); |
147 | 147 | } |
148 | 148 |
|
149 | 149 | if(config.borderColorOnError !== '') { |
|
274 | 274 | // Remove possible error messages from last validation |
275 | 275 | // |
276 | 276 | $('.' + $.split(config.errorMessageClass, ' ').join('.')).remove(); |
277 | | - $('.jquery_form_error_message').remove(); |
| 277 | + $('.'+config.errorMessageClass).remove(); |
278 | 278 |
|
279 | 279 | // |
280 | 280 | // Run validation callback |
|
316 | 316 | else { |
317 | 317 | for (var i = 0; i < errorInputs.length; i++) { |
318 | 318 | var $parent = errorInputs[i].parent(); |
319 | | - var $errorSpan = $parent.find('span[class=jquery_form_error_message]'); |
| 319 | + var $errorSpan = $parent.find('span[class='+config.errorMessageClass+']'); |
320 | 320 | if ($errorSpan.length > 0) { |
321 | 321 | $errorSpan.eq(0).text(errorInputs[i].valAttr('current-error')); |
322 | 322 | } else { |
323 | | - $parent.append('<span class="jquery_form_error_message">' + errorInputs[i].valAttr('current-error') + '</span>'); |
| 323 | + $parent.append('<span class="'+config.errorMessageClass+'">' + errorInputs[i].valAttr('current-error') + '</span>'); |
324 | 324 | } |
325 | 325 | } |
326 | 326 | } |
|
465 | 465 | ignore : [], // Names of inputs not to be validated even though node attribute containing the validation rules tells us to |
466 | 466 | errorElementClass : 'error', // Class that will be put on elements which value is invalid |
467 | 467 | borderColorOnError : 'red', // Border color of elements which value is invalid, empty string to not change border color |
468 | | - errorMessageClass : 'jquery_form_error_message', // class name of div containing error messages when validation fails |
| 468 | + errorMessageClass : 'form-error', // class name of div containing error messages when validation fails |
469 | 469 | validationRuleAttribute : 'data-validation', // name of the attribute holding the validation rules |
470 | 470 | validationErrorMsgAttribute : 'data-validation-error-msg', // define custom err msg inline with element |
471 | 471 | errorMessagePosition : 'element', // Can be either "top" or "element" |
|
0 commit comments