I have a form on a page that is generated dynamically.
One of the fields is:
<input type="hidden" name="pageURL" id="pageURL" value="" />
I'd like to on page load set that value with the current browsers url using:
$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
I can't simply put that php into value=""
because that field is generated dynamically. But is there simply javascript or jQuery to load the current page url in the users browser (parameters and all) into a value of an input on a page?