Skip to content

Commit

Permalink
Fix validation diaply on lists...
Browse files Browse the repository at this point in the history
  • Loading branch information
dvlpp committed Nov 11, 2015
1 parent 65bc4ac commit 6704e55
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions resources/assets/js/sharp.form.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ $(function() {
var errors = jqXhr.responseJSON;

$.each(errors, function (key, value) {
if((pos = key.indexOf(".")) != -1) {
// It's a list item
key = key.substring(0, pos);
}
var $field = $form.find(".sf-" + key);
$field.addClass("has-error");
$field.append('<span class="validation-error">' + value[0] + '</span>');
Expand Down
4 changes: 4 additions & 0 deletions resources/assets/sharp.form.js
Original file line number Diff line number Diff line change
Expand Up @@ -28853,6 +28853,10 @@ $(function() {
var errors = jqXhr.responseJSON;

$.each(errors, function (key, value) {
if((pos = key.indexOf(".")) != -1) {
// It's a list item
key = key.substring(0, pos);
}
var $field = $form.find(".sf-" + key);
$field.addClass("has-error");
$field.append('<span class="validation-error">' + value[0] + '</span>');
Expand Down
4 changes: 2 additions & 2 deletions resources/assets/sharp.form.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/assets/sharp.ui.min.js

Large diffs are not rendered by default.

0 comments on commit 6704e55

Please sign in to comment.