Listening to Submit Response

After form submission, Ninja Forms sends a Backbone.Radio message that the form has been submitted. Listening to this message you can trigger custom JavaScript based on the response.

// Create a new object for custom validation of a custom field.
var mySubmitController = Marionette.Object.extend( {
initialize: function() {
this.listenTo( 'forms' ), 'submit:response', this.actionSubmit );
actionSubmit: function( response ) {
// Do stuff here.
// On Document Ready…
jQuery( document ).ready( function( $ ) {
// Instantiate our custom field's controller, defined above.
new mySubmitController();