I show in iFrame my contact form (for leads). What I need to do is to save the parent url, then to insert this url to my hidden field before the form is submitted (or on the page load). I need to know from what url the form was submitted.
I have code that works only is chrome console. but when I put this code in the parent html the code is there but not working
jQuery(".gfiframe").contents().find("#gform_submit_button_1").click(function(){
jQuery(".gfiframe").contents().find("#input_1_2").val('test');
});
To get the parent url I use
var $location = location.host;