私は、フォームバリデータのリセット機能をコピーしました。
//CIRO : Its a copy of the JS without the element errorMessageCustom
var configReset = {
ignore: [], // Names of inputs not to be validated even though node attribute containing the validation rules tells us to
errorElementClass: 'error', // Class that will be put on elements which value is invalid
borderColorOnError: '#b94a48', // Border color of elements which value is invalid, empty string to not change border color
errorMessageClass: 'form-error', // class name of div containing error messages when validation fails
validationRuleAttribute: 'data-validation', // name of the attribute holding the validation rules
validationErrorMsgAttribute: 'data-validation-error-msg', // define custom err msg inline with element
errorMessagePosition: 'element', // Can be either "top" or "element" or "custom"
errorMessageTemplate: {
container: '<div class="{errorMessageClass} alert alert-danger">{messages}</div>',
messages: '<strong>{errorTitle}</strong><ul>{fields}</ul>',
field: '<li>{msg}</li>'
},
scrollToTopOnError: true,
dateFormat: 'yyyy-mm-dd',
addValidClassOnAll: false, // whether or not to apply class="valid" even if the input wasn't validated
decimalSeparator: '.',
inputParentClassOnError: 'has-error', // twitter-bootstrap default class name
inputParentClassOnSuccess: 'has-success', // twitter-bootstrap default class name
validateHiddenInputs: false // whether or not hidden inputs should be validated
}
//you can search the code with the text "reset.validation" at the "jquery.form-validator.js"
function resetValidation(idForm){
$elems1 = $("#"+idForm).find('.' + 'error' + ',.valid');
$("#"+idForm).find('.' + 'error' + '.alert').remove();
$.formUtils.errorDialogs.removeErrorStyling($elems1, configReset);
}
このコードは、緊急時であったと
を向上させることができます