Advertisement
jamescolin

RPM page5 eventlistener

Feb 24th, 2022 (edited)
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.   waitforformready();
  3.  
  4.   function waitforformready() {
  5.     let myform = document.querySelector("form");
  6.    
  7.     if ( myform == null ) {
  8.       setTimeout(waitforformready, 1000);
  9.     } else {
  10.       myform.addEventListener('submit', setautomagicallink);
  11.     }
  12.   }
  13.  
  14.   function setautomagicallink(event) {
  15.     let myaid = document.querySelector("[name='custom aid']").value.trim();
  16.     let mylink = document.querySelector("[name='custom link']").value.trim();
  17.     let myaffiliate = document.querySelector("[name='custom affiliate']").value.trim();
  18.     let mymailingboss = document.querySelector("[name='custom mailingboss']").value.trim();
  19.  
  20.     let myautomagicallink = 'https://w.rapidprofitmachine.com/?affiliate='+encodeURIComponent(myaffiliate)+'&aid='+myaid+'&mailingboss='+mymailingboss+'&link='+encodeURIComponent(mylink);
  21.    
  22.     let myinput = document.querySelector("[name='custom automagicallink']");
  23.     jameschangevalue(myinput,myautomagicallink);
  24.     myinput.setAttribute('value', myautomagicallink);
  25.    
  26.     return true;
  27.   }
  28.  
  29.   function jameschangevalue(el,value){
  30.       var nativeInputValueSetter = Object.getOwnPropertyDescriptor(
  31.         window.HTMLInputElement.prototype,
  32.         "value"
  33.       ).set;
  34.       nativeInputValueSetter.call(el, value);
  35.       var inputEvent = new Event("input", { bubbles: true });
  36.       el.dispatchEvent(inputEvent);
  37.   }
  38. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement