Created
July 5, 2022 21:57
-
-
Save bryanwillis/f2fa835f2bff914ca2f25d7b546d0707 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fillFormEmail(){ | |
const input = document.getElementById('team_name-866'); // replace 'id' with id of email field | |
const queryString = window.location.search; | |
const urlParams = new URLSearchParams(queryString); //parse the query string | |
const teamname = urlParams.get('team'); // Store the parsed email address in variable | |
input.value = teamname; // fill the form with the email address | |
} | |
if (document.readyState === 'loading') { // Loading hasn't finished yet | |
document.addEventListener('DOMContentLoaded', fillFormEmail) | |
} | |
else { // `DOMContentLoaded` has already fired | |
fillFormEmail(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment