Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (window.localStorage) {
- $(function () {
- function enableCaptureOnSubmit () {
- $('form').off('.field-capture');
- $('form').on('submit.field-capture', function () {
- var $this = $(this);
- var name = $this.find('input[placeholder*="First name"]').val(); // Adjust these to match as necessary
- var email = $this.find('input[placeholder*="Email address"]').val();
- if (undefined !== name && undefined !== email) {
- localStorage.setItem('optin-name', name);
- localStorage.setItem('optin-email', email);
- }
- });
- }
- setTimeout(enableCaptureOnSubmit, 0);
- try {
- var bmo = new MutationObserver(enableCaptureOnSubmit);
- bmo.observe(document.body, { childList: true, subtree: true });
- } catch (e) {}
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement