updated the proper file this time...
This commit is contained in:
parent
87448147e5
commit
8ddfa1db67
|
|
@ -20,6 +20,13 @@ $(function() {
|
|||
},
|
||||
error: function(data, statusText, xhr, $form) {
|
||||
$submitButton = $form.find('input[type=submit]');
|
||||
|
||||
// Form validation error.
|
||||
if (422 == data.status) {
|
||||
processFormErrors($form, $.parseJSON(data.responseText));
|
||||
return;
|
||||
}
|
||||
|
||||
toggleSubmitDisabled($submitButton);
|
||||
showMessage('Whoops!, it looks like something went wrong on our servers.\n\
|
||||
Please try again, or contact support if the problem persists.');
|
||||
|
|
@ -167,6 +174,30 @@ $(function() {
|
|||
|
||||
});
|
||||
|
||||
function processFormErrors($form, errors)
|
||||
{
|
||||
$.each(errors, function (index, error)
|
||||
{
|
||||
var $input = $(':input[name=' + index + ']', $form);
|
||||
|
||||
if ($input.prop('type') === 'file') {
|
||||
$('#input-' + $input.prop('name')).append('<div class="help-block error">' + error + '</div>')
|
||||
.parent()
|
||||
.addClass('has-error');
|
||||
} else {
|
||||
if($input.parent().hasClass('input-group')) {
|
||||
$input = $input.parent();
|
||||
}
|
||||
|
||||
$input.after('<div class="help-block error">' + error + '</div>')
|
||||
.parent()
|
||||
.addClass('has-error');
|
||||
}
|
||||
});
|
||||
|
||||
var $submitButton = $form.find('input[type=submit]');
|
||||
toggleSubmitDisabled($submitButton);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle a submit button disabled/enabled - duh!
|
||||
|
|
@ -202,6 +233,9 @@ function clearFormErrors($form) {
|
|||
$($form).find(':input')
|
||||
.parent()
|
||||
.removeClass('has-error');
|
||||
$($form).find(':input')
|
||||
.parent().parent()
|
||||
.removeClass('has-error');
|
||||
}
|
||||
|
||||
function showFormError($formElement, message) {
|
||||
|
|
|
|||
|
|
@ -3926,8 +3926,8 @@ function log() {
|
|||
|
||||
// Form validation error.
|
||||
if (422 == data.status) {
|
||||
processFormErrors($form, $.parseJSON(data.responseText));
|
||||
return;
|
||||
processFormErrors($form, $.parseJSON(data.responseText));
|
||||
return;
|
||||
}
|
||||
|
||||
toggleSubmitDisabled($submitButton);
|
||||
|
|
@ -4077,6 +4077,30 @@ function log() {
|
|||
|
||||
});
|
||||
|
||||
function processFormErrors($form, errors)
|
||||
{
|
||||
$.each(errors, function (index, error)
|
||||
{
|
||||
var $input = $(':input[name=' + index + ']', $form);
|
||||
|
||||
if ($input.prop('type') === 'file') {
|
||||
$('#input-' + $input.prop('name')).append('<div class="help-block error">' + error + '</div>')
|
||||
.parent()
|
||||
.addClass('has-error');
|
||||
} else {
|
||||
if($input.parent().hasClass('input-group')) {
|
||||
$input = $input.parent();
|
||||
}
|
||||
|
||||
$input.after('<div class="help-block error">' + error + '</div>')
|
||||
.parent()
|
||||
.addClass('has-error');
|
||||
}
|
||||
});
|
||||
|
||||
var $submitButton = $form.find('input[type=submit]');
|
||||
toggleSubmitDisabled($submitButton);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle a submit button disabled/enabled - duh!
|
||||
|
|
@ -4115,7 +4139,6 @@ function clearFormErrors($form) {
|
|||
$($form).find(':input')
|
||||
.parent().parent()
|
||||
.removeClass('has-error');
|
||||
|
||||
}
|
||||
|
||||
function showFormError($formElement, message) {
|
||||
|
|
@ -4192,32 +4215,6 @@ $.extend(
|
|||
}
|
||||
});
|
||||
|
||||
function processFormErrors($form, errors)
|
||||
{
|
||||
$.each(errors, function (index, error)
|
||||
{
|
||||
var $input = $(':input[name=' + index + ']', $form);
|
||||
|
||||
if ($input.prop('type') === 'file') {
|
||||
$('#input-' + $input.prop('name')).append('<div class="help-block error">' + error + '</div>')
|
||||
.parent()
|
||||
.addClass('has-error');
|
||||
} else {
|
||||
if($input.parent().hasClass('input-group')) {
|
||||
$input = $input.parent();
|
||||
}
|
||||
|
||||
$input.after('<div class="help-block error">' + error + '</div>')
|
||||
.parent()
|
||||
.addClass('has-error');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var $submitButton = $form.find('input[type=submit]');
|
||||
toggleSubmitDisabled($submitButton);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Smooth Scroll - v1.4.13 - 2013-11-02
|
||||
* https://github.com/kswedberg/jquery-smooth-scroll
|
||||
|
|
|
|||
Loading…
Reference in New Issue