Skip to content

form submit with validate by default #207

@belozer

Description

@belozer

Now:

    _onSubmit : function(e) {
        e.preventDefault();
        this._emit('submit', this.getVal());
    },

With validate by default:

    _onSubmit: function(e, data) {
      e.preventDefault();
      this.validate().then(fieldsStatuses => {
        if (this.checkFields(fieldsStatuses)) {
          this._emit('submit', this.getVal());
        } else {
          this.getInvalidFields().then(invalidFields => {
            invalidFields[0].getControl().setMod('focused');
          });
        }
      });
    }

or add new event success, or data

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions