AnsweredAssumed Answered

iFrame - pull Parent URL into Hidden form field

Question asked by 22685 on Apr 16, 2014
Latest reply on Apr 27, 2014 by 1e822ea2815a81658e6c21c7e1edf479567ba39c
     I've identified some javascript which allows me to pull the full URL of the parent page into a hidden form field in an iFrame.  The probelm is, this code only works on Forms 1.0.

     Can anyone suggest tweaks to this code so that it will work with Forms 2.0?



<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<!-- Keep your jQuery up to date -->
      
<script>
      
  $(function(){
    var url = (window.location != window.parent.location) ? document.referrer: document.location;
    $("#LeadSource").val(url);
  })
    
      
</script>

Outcomes