Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- document.addEventListener('om.Form.init', function( evt ) {
- var { Campaign } = evt.detail;
- var input;
- // Only do this for a specific campaign
- if ( '<slug>' !== Campaign.id ) {
- return;
- }
- input = document.createElement('input');
- input.type = 'hidden';
- input.name = 'debugInfo';
- input.value = '';
- input.id = Campaign.ns + '-debugInfo';
- document.querySelector('.' + Campaign.ns + '-FieldsElement--content').appendChild(input);
- document.addEventListener('om.Optin.init', function( evt ) {
- if ( Campaign.id === evt.detail.Campaign.id ) {
- input.value = JSON.stringify( { products_form: jQuery(document.forms.products_form).serialize() } );
- }
- } );
- } );
- </script>
Add Comment
Please, Sign In to add comment