All I am looking to do is autofill a hidden text field with the current page URL, so that when the user submits the form, I know the page they sent the form from. This will save me a ton of headaches dealing with inquiries.
In other words, when the page loads, I’d need the text field value to be value=”http://www.example.com/”
Ideally, looking to accomplish this with just Javascript/HTML.
Any help would be much appreciated. Thanks!
Assuming you can give your hidden field an ID, put the following in your
onloador document-ready processing: