Replaced manual function with existing one.

This commit is contained in:
JapSeyz 2016-06-19 15:06:57 +02:00
parent 8ddfa1db67
commit 8e3338dbc7
2 changed files with 4 additions and 34 deletions

View File

@ -53,24 +53,9 @@ $(function() {
case 'error':
if (data.messages) {
$.each(data.messages, function(index, error) {
/*
* use the class as the selector if the input name is an array.
*/
var selector = (index.indexOf(".") >= 0) ? '.' + index.replace(/\./g, "\\.") : ':input[name=' + index + ']';
$(selector, $form)
.after('<div class="help-block error">' + error + '</div>')
.parent()
.addClass('has-error');
});
processFormErrors($form, data.messages);
return;
}
var $submitButton = $form.find('input[type=submit]');
toggleSubmitDisabled($submitButton);
break;
default:

View File

@ -3956,24 +3956,9 @@ function log() {
case 'error':
if (data.messages) {
$.each(data.messages, function(index, error) {
/*
* use the class as the selector if the input name is an array.
*/
var selector = (index.indexOf(".") >= 0) ? '.' + index.replace(/\./g, "\\.") : ':input[name=' + index + ']';
$(selector, $form)
.after('<div class="help-block error">' + error + '</div>')
.parent()
.addClass('has-error');
});
processFormErrors($form, data.messages);
return;
}
var $submitButton = $form.find('input[type=submit]');
toggleSubmitDisabled($submitButton);
break;
default: