Relative Link in https://cdn.jotfor.ms/static/jotform.forms.js?3.3.11410

  • Profile Image
    HelpfulHolidays
    Asked on February 16, 2016 at 05:36 AM

    Hello, 

    In my implementation of Jot form I have made a system where I use PHP file_get_contents() on your iframe, then I create a new Iframe on the website,

    This allows me to inject dynamic select options and pre fill parts of the form etc.

    I have an issue with https://cdn.jotfor.ms/static/jotform.forms.js?3.3.11410 this line:

    {var self=this;this.loadScript('/js/form.edit.mode.js?v_'+(new Date()).getTime(),function(){self.editMode=editModeFunction;self.editMode(data,noreset,skipField);}

    It causing a JS error and will not fire the events because the link has become relative to my Iframe.

    i.e https://
    www.mywebsite/js/form.edit.mode.js not https://form.jotform.com/js/form.edit.mode.js

    My question is - is there a quick way to force this link to point to https://form.jotform.com/ maybe I could ass some variable to the page?

    How is this achieved in the Source Code version when I publish a form?


    Thanks.

     

  • Profile Image
    mert
    Answered on February 16, 2016 at 09:19 AM

    Hi there,

    As far as I understand your post, maybe you should change the URL of the form while you are using the "file_get_contents()" PHP function. Please, type the your form's current URL between the functions brackets.

    For example:

     

     <?php

    print file_get_contents("http://url/of/the/form");

     ?>

     

    Because the line you picked from the https://cdn.jotfor.ms/static/jotform.forms.js?3.3.11410 has nothing to do with your iframe. I hope this information will work for you.

     

    Thanks.

  • Profile Image
    HelpfulHolidays
    Answered on February 16, 2016 at 09:45 AM

    Hello,

    the forms url would be 

    'https://secure.jotformeu.com/form/'.$_form_id.$s_session

    or

    https://secure.jotformeu.com/form/52293475752967&session=someone@someone.com

     

     

    Then when displayed on my site the url is something like,

    https://www.mysebsite.com/form/52293475752967&session=someone@someone.com

    Which breaks the call to /form.edit.mode.js because that was designed to be relative to https://secure.jotformeu.com/ and not https://www.mysebsite.com/ if you see what i mean.

     

     

     

    Thanks.

  • Profile Image
    david
    Answered on February 16, 2016 at 01:21 PM

    Would you mind sharing a link to your page?  The URL should not be changing from

    https://secure.jotformeu.com

    to

    https://www.mysebsite.com

    Is there something in your script causing the change?

  • Profile Image
    HelpfulHolidays
    Answered on February 17, 2016 at 05:44 AM

     

    Hello,

     

    The link https://secure.jotformeu.com is not actually a link to https://secure.jotformeu.com its a link to /js/form.edit.mode.js (its relative not absolute)

     

    So if you think about it when I'm viewing the YOUR iframe the link points to https://secure.jotformeu.com and when I'm viewing MY iframe its pointing to my website address because the links is relative to the owner / address of the iframe.

     

    Don't worry to much about it now, I have actually solved the issue and can once again do every thing I need to do.

     

    Thanks.

    :)

     

  • Profile Image
    mert
    Answered on February 17, 2016 at 07:48 AM

    I'm glad to see that you have found a solution about your problem and also, on behalf of my colleague you are kindly welcome. If you need any further assistance, please always feel free to contact us.

     

    Thanks.