NikolayBezay

Adoric embed to add current URL like a hidden field to the LB form.

Nov 18th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.53 KB | None | 0 0
  1. <script>
  2.     (function() {
  3.     var DYNAMIC_URL_FIELD_NAME = 'leadPageUrl';
  4.         var form = document.querySelector('.' + self.identifier + ' div[tabindex] form');
  5.  
  6.         function addHiddenInput(name, val) {
  7.             var inp = document.createElement('INPUT');
  8.             inp.type = 'hidden';
  9.             inp.name = name;
  10.             inp.value = val;
  11.             if (form) {
  12.                 form.appendChild(inp);
  13.             }
  14.         }
  15.         addHiddenInput(DYNAMIC_URL_FIELD_NAME, window.location.href);
  16.     })();
  17. </script>
Advertisement
Add Comment
Please, Sign In to add comment