What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Get Referrer Widget is not pulling the entire URL of the page

    Asked by duhiminsk on May 16, 2015 at 08:02 AM

    Hello, i have items url like this: 

    http://duhi-minsk.by/items#Versense_by_Versace_smell_24veto25n29e_myskysn29e_vol_100ml_price_329_000

     

    I receive from Get Referrer only:

    http://duhi-minsk.by/items

     

    I'm using Jquery and "#" for item displaying.

    Can you help me?

    Page URL:
    http://duhi-minsk.by/ 

    referrer get referrer widget get referrer script conflict
  • Profile Image
    JotForm Support

    Answered by Jan on May 16, 2015 at 10:30 AM

    May I know what do you mean it is not working? Are you not getting the URL? 

    Please share the form where the widget is embedded. I checked your webpage and I found 3 JotForm forms embedded. Are they all embedded using iFrame?

  • Profile Image
    JotForm Support

    Answered by Jan on May 16, 2015 at 10:38 AM

    It is possible that there are conflicts between the scripts. 

    1. Use iFrame to avoid script conflicts. 

    <iframe id="JotFormIFrame" onload="window.parent.scrollTo(0,0)" allowtransparency="true" src="//form.jotformeu.com/form/FORMID" frameborder="0" style="width:100%; height:465px; border:none;" scrolling="no"></iframe>

    <script type="text/javascript">window.handleIFrameMessage = function(e) {var args = e.data.split(":");var iframe = document.getElementById("JotFormIFrame");if (!iframe)return;switch (args[0]) {case "scrollIntoView":iframe.scrollIntoView();break;case "setHeight":iframe.style.height = args[1] + "px";break;}};if (window.addEventListener) {window.addEventListener("message", handleIFrameMessage, false);} else if (window.attachEvent) {window.attachEvent("onmessage", handleIFrameMessage);}</script>

    2. If  it is still the same, remove the script code below the iFrame code.

    <iframe id="JotFormIFrame" onload="window.parent.scrollTo(0,0)" allowtransparency="true" src="//form.jotformeu.com/form/FORMID" frameborder="0" style="width:100%; height:465px; border:none;" scrolling="no"></iframe>

  • Profile Image

    Answered by duhiminsk on May 16, 2015 at 10:52 AM

    I can't using iframe because i need to import item name in form by jquery, so i export form for dreamweaver.

    I can't insert item name in iframe, maybe it's possible, but i don't know how.

    I tryed:

    $('iframe').find('#input_1').val('Versace Birght Crystal(for example)')

    not working

    http://duhi-minsk.by/items

  • Profile Image

    Answered by Sammy on May 16, 2015 at 12:33 PM

    Actually to access an iframe content it need to originate from the dame domain, otherwise it is blocked for security reasons that's why you are not getting any value.

    Without iframe embedding you will need to use the full jquery name to avoid conflicts

     

    //$('iframe').find('#input_1').val('Versace Birght Crystal(for example)')

    jQuery('#formID').contents().find('#input_1').val()

    Try this and tell me how it goes

  • Profile Image

    Answered by duhiminsk on May 18, 2015 at 05:03 AM

    Thanks, it doesn't works, beacause of same-origin policy

    So i will return to first question about Get Referrer

    How to receive from Get Referrer all page adress, including # and all that goes over it?

  • Profile Image

    Answered by Sammy on May 18, 2015 at 07:32 AM

    To get the full URL of the referrer page use the following JavaScript

    <script>

    //get the current url and assign to avariable

    var loc = window.location.toString();

    </script>

    This gets the url of the current page opened in your browser, i you have any further questions feel free to ask.

  • Profile Image

    Answered by duhiminsk on May 19, 2015 at 08:19 AM

    I know this. It works, but after form confirmation it redirects on captcha page, its not cool

  • Profile Image
    JotForm Support

    Answered by Welvin on May 19, 2015 at 12:21 PM

    Try to implement the jQuery noconflict in your website. It should help.

    https://api.jquery.com/jquery.noconflict/ 

    Let us know if you need further assistance.

    Thanks

  • Profile Image

    Answered by duhiminsk on May 23, 2015 at 07:35 AM

    Thanks. Doesn't work. The iframe must be located on the same domain.

  • Profile Image
    JotForm Support

    Answered by Jan on May 23, 2015 at 08:56 AM

    Did you already apply the noConflict()? You need to add it before the JotForm script or code.