URL parameters added from attendee’s informations?
-
Hello guys!
I am trying to append URL parameters from the attendee’s informations when a user buy an event ticket so that I can prepopulate the same infos in the billing fiels on the checkout page.
In this case, the value of the input “First Name” should then be added to the URL after the user click the submit button.
The user would then be taken to https://website.com/checkout?firstname=John
This is my attempt at creating this with JS:setTimeout(function() { const form = document.getElementById('tribe-tickets__registration-form'); form.addEventListener('submit', function(event) { const firstName = document.getElementById('tribe-tickets_29226_first-name_{{data.attendee_id}}').value; const actionUrl = form.action; const newUrl = ${actionUrl}?firstName=${firstName}; form.action = newUrl; }); }, 5000);
I added the Timeout so the registration form has the time to completely load first.
Note: I’m using event ticket and event ticket plus as well as WooCommerce Checkout Field Editor
I had no luck making this work. Anyone has some insight?
Thank you !The page I need help with: [log in to see the link]
- The topic ‘URL parameters added from attendee’s informations?’ is closed to new replies.