How can I pre-populate the referrer field when using JavaScript embed instead of iFrame?

  • Profile Image
    hosker4u
    Asked on July 22, 2011 at 02:36 PM
  • Profile Image
    NeilVicente
    Answered on July 22, 2011 at 03:58 PM

    Hi hosker4u,

    Pre-populating the hidden "website" field for JavaScript embed codes can be achieved in the same way as with iframe codes.

    Just append the querystrings right after the JavaScript embed url. For example, if the name of the website where the form is to be embedded is "Site-1", append the input name of the hidden field (website) preceeded by a question mark, followed by an equals sign and the name of the website, "Site-1".

    Hope you find this answer helpful. Let us know if there's anything else you'd like to ask. Thank you and have a nice day!


    Neil

  • Profile Image
    hosker4u
    Answered on July 23, 2011 at 11:07 AM

    Thanks Neil,

    I have tried the code below, but it does not seem to be working, I used the input name AND then went to view source and tried the name the code gave. No luck so far:

     

    <script src="//form.jotform.com/jsform/12023016200?input_1=the44"></script>
    or
    <script src="//form.jotform.com/jsform/12023016200?q1_custom11=the44"></script>
    or
    <script src="//form.jotform.com/jsform/12023016200?custom1=the44"></script>

  • Profile Image
    NeilVicente
    Answered on July 23, 2011 at 11:37 AM

    Hi,

    You should look up the name property of your hidden input and get only the value after the underscore:

    Therefore, this code should work:

    I tested this code and submitted on your form and it worked perfectly fine. The value is successfully stored in the submission entry:

     

    There is no reason why it would not work for you.


    Neil

  • Profile Image
    hosker4u
    Answered on July 23, 2011 at 12:07 PM

    I am guessing maybe a cache - it is now working fine. Thanks for the help Neil.

  • Profile Image
    NeilVicente
    Answered on July 23, 2011 at 01:39 PM

    It probably is just an issue with the cache. You are very much welcome. Feel free to contact us again for assistance with regards to your forms. Thanks!


    Neil