Hi @garagesteve1155,
You can use following jQuery code to populate a text field from url ( Where sometextfiled-5 is the input field ID, you can use browser inspection tool to find your invite field id)
jQuery(document).ready(function(){
var params = getUrlVars();
jQuery('input#sometextfiled-5').val(params['invite']);
});
function getUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
Thanks.
Thanks! Where do I put this code on wordpress?
Hi @garagesteve1155,
You can use a plugin like this https://wordpress.org/plugins/page-specific-scripts/ to add this code in your register page. There might be other similar plugins available which lets you add js code in specific page. Go to Pages->Registration->Edit, inside dashboard & add the code there.
Thanks.
Hi @garagesteve1155,
Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂
Regards,
Thanks I will give this a try!
Hi @garagesteve1155
You can also try this tutorial to populate the Registration fields from URL.
Regards,