How do I pass URL into hidden field for Popup form linked from an image?

  • Profile Image
    humbuckermusic
    Asked on August 01, 2013 at 09:15 AM

    Hereis what I am using now, but it doesn't work, so I know I'm doing something wrong.  I got this code from a different thread on this forum.

     

    <script>

    var referrer = window.parent.location.href;

    document.write("<a target="_blank" href=\"javascript:void( window.open(\'http://form.jotform.us/form/32123607120135?hiddenfield=\' +referrer, \'blank\',\'scrollbars=yes,toolbar=no,width=460,height=550\'))\"><img src="//lib.store.yahoo.net/lib/humbucker/notify-stock-small.jpg" height="27" width="145">Stock Notification</a>");

    </script>

    Also, I'm not too sure how I would get the popup to come up when an image is clicked.  As you can see, the image is located here: http://lib.store.yahoo.net/lib/humbucker/notify-stock-small.jpg

    Any ideas?  Thanks!

     

     

     

  • Profile Image
    EltonCris
    Answered on August 01, 2013 at 12:08 PM

    Hi,

    Let us work on this and get back to you. Please stay tuned!

    Regards!

  • Profile Image
    EltonCris
    Answered on August 01, 2013 at 12:17 PM

    You may try this code:

    <script>

    var referrer = window.parent.location.href;

    document.write("<a target="_blank" href=\"javascript:void( window.open('http://form.jotform.us/form/32123607120135?referrer=' +referrer, 'blank','scrollbars=yes,toolbar=no,width=460,height=550'))\"><img src='//lib.store.yahoo.net/lib/humbucker/notify-stock-small.jpg'></a>");

    </script>

    Demo: https://shots.jotform.com/elton/demo_251265.html

    You will notice there's a captured window URL on top ?referrer=captured window URL.

    Let us know if you need anything else. Thanks!