Actually figured it out using cookies…
Added this to my themes custom js file…
var mySubmitController = Marionette.Object.extend( {
initialize: function() {
this.listenTo( Backbone.Radio.channel( 'forms' ), 'submit:response', this.actionSubmit );
},
actionSubmit: function( response ) {
// delete any old subid cookies... (probably not necessary since we're (re)setting it below but whatever)
document.cookie = 'subid=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
var subID = response.data.actions.save.sub_id;
// just to make sure we're getting the correct sub_id...
console.log('SUB ID: ' + subID);
// you can see all the data for this form submission...
console.log(response);
// set a cookie to hold the sub_id...
document.cookie = 'subid=' + subID + '; expires=Thu, 31 Dec 2030 12:00:00 UTC; path=/';
},
});
jQuery( document ).ready( function( $ ) {
// Instantiate our custom field's controller, defined above.
new mySubmitController();
});
At this point you should have a cookie ‘subid’ with a value of the submission id. You can do with that whatever you need. I’m getting/displaying mine on the redirect page with php:
$sub_id = $_COOKIE['subid'];
echo 'sub_id: ' . $sub_id;
There may be a more reliable and efficient way to do this but this works for my purposes.
-
This reply was modified 6 years ago by shagdirty.