Skip to content

Commit

Permalink
Fix bug in form error display logic, which throws exception and preve…
Browse files Browse the repository at this point in the history
…nts event for after phase to be triggered.
  • Loading branch information
jianwu committed Sep 10, 2015
1 parent e570cdd commit c728584
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/w2form.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
var eventData = this.trigger({ phase: 'before', target: this.name, type: 'validate', errors: errors });
if (eventData.isCancelled === true) return;
// show error
if (showErrors) for (var e in eventData.errors) {
if (showErrors) for (var e = 0; e < eventData.errors.length; e++) {
var err = eventData.errors[e];
if (err.field.type == 'radio') { // for radio and checkboxes
$($(err.field.el).parents('div')[0]).w2tag(err.error, { "class": 'w2ui-error' });
Expand Down

0 comments on commit c728584

Please sign in to comment.