After-form-submit Event

Lisa Fockens Updated by Lisa Fockens

The after-form-submit event is fired after the submission of a signup block form. This is one of the various events Wisepops can trigger as part of our JS callbacks feature.

Prevent action after submission

The action after the form submission can be prevented, by calling preventDefault() on the event:

wisepops('listen', 'after-form-submit', function(event) {
  event.preventDefault();
});

Preventing this event will only cancel the action (go to next step, load new page, scroll to anchor, close popup). The data filled will still be collected. 

Please refer to the before-form-submit event to prevent the whole form submission.

Event target

The targeted element (event.target) is the same element as the native submit event target.

This means that you can easily retrieve the fields of your form (and their values) by using event.target.elements['Field ID'] . To retrieve the email value, you must write:

var emailValue = event.target.elements['email'].value;

Use cases

After-tracked-click Event

Before-form-submit Event

Contact