Navigation Menu

Skip to content

Commit

Permalink
fixed JS to show validation errors as server is now sending status co…
Browse files Browse the repository at this point in the history
…de 400
  • Loading branch information
cnenning committed Feb 21, 2017
1 parent 9fcf2df commit c8630ac
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -112,8 +112,13 @@ function ajaxFormValidation(event) {
if (restoreFunction) {
restoreFunction();
}
// show user an error message
_handleValidationResult(_form, {errors: ['Network or server error!']})
// struts sends status code 400 when validation errors are present
if (xhr.status === 400) {
_handleValidationResult(_form, JSON.parse(xhr.responseText))
} else {
// a real error occurred -> show user an error message
_handleValidationResult(_form, {errors: ['Network or server error!']})
}
}
}
Expand Down

0 comments on commit c8630ac

Please sign in to comment.