JSFiddle - React, Tailwind, and code Playground

by mhouser_nowmediagroup

HTML

<div id="output"></div>

<form accept-charset="UTF-8" action="https://blah.formy.net" class="infusion-form" id="inf_form_2bddccc1e5f020a10eb95af4f96f99ca" method="POST">
    <input name="inf_form_xid" type="hidden" value="2bddccc1e5f020a10eb95af4f96f99ca">
    <input name="inf_form_name" type="hidden" value="Hidden Form&amp;#a;(E = Hidden)">
    <input name="inf_field_Email" type="email" value="null" style="">
    <button type="submit">Sign Up</button>
<input type="hidden" id="timeZone" name="timeZone" value="America/Los_Angeles"></form>

JavaScript

jQuery(window).on("load", function(){
  var link = window.location.href + "&stuff&things&email=radfish%40skewlofroot.com&other_stuff_too"
  var start_index, end_index
  var current_index = (/%40/.exec(link)).index
  while(link[current_index] != '=')
    start_index = current_index--
  while(link[current_index] != '&')
   end_index = ++current_index
  var email_address = (link.substring(start_index, end_index)).replace("%40", '@')

  jQuery("#inf_form_2bddccc1e5f020a10eb95af4f96f99ca > [name^='inf_field_Email']").val(email_address)
})