Skip to content

Prevent default doesn't work in a form submit event handler #80

@romaroma

Description

@romaroma

We have a regular form submit event handler that just routes to another route when someone click the button. return false here prevents browser from actual form submission attempt which is desired behavior. However after installing zones this functionality was broken, the browser began to submit the form.

Removing the package helped solve the problem.

// events handler
Template.adminTranslations.events({
  'submit #addTranslation': function(e){
    Router.go('adminTranslationCreate');
    return false;
  }
});

Notes: We use iron:router and several Router.onBeforeAction hooks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions