jQuery(document).ready(function( $ ){ var url = window.location.href; $('#product_url').val(url); });