When embedding a form onto a web page does the JavaScript embed code remain consistent other than the form URL which is contained in it?

  • Profile Image
    Jaf3778
    Asked on November 29, 2018 at 09:42 PM
    Further, when embedding a form onto a web page does the JavaScript embed code remain consistent other than the form URL which is contained in it? Thank you
  • Profile Image
    John_Benson
    Answered on November 29, 2018 at 09:44 PM

    Hi,

    Yes, it is consistent. To embed the form, please follow this guide: https://www.jotform.com/help/34-Adding-a-Form-to-a-Web-Page

    We also suggest using the iFrame method if there's a lot of script to the webpage. Here's a guide: https://www.jotform.com/help/148-Getting-the-Form-iFrame-Code


  • Profile Image
    Jaf3778
    Answered on November 30, 2018 at 07:43 AM
    Thanks- I am curious, what are the benefits to using the java method over
    the iframe method? For example, I use the conditions to protect the submit
    button to make my form secure. I know that someone can view the source code
    of a jotform & sift through to find the code to reveal the submit button
    condition code needed to reveal it. However, it does not appear that they
    can do that when embedding the form using java in my wordpress page. Is
    this accurate & can you provide any other comparisons, Thanks :-)
    ...
  • Profile Image
    Kevin_G
    Answered on November 30, 2018 at 10:32 AM

    The difference between the default embed method (JavaScript code) and the iFrame is that you are able to handle the iFrame while using the second one, the default method will only display the form on your website and it will automatically generate the iFrame and its settings. 

    So far, there is no way to avoid users from inspecting the page's source code, if they do so, they will be able to see the HTML and JavaScript codes used, the server side code is not shown to users. 

    Thanks. 

  • Profile Image
    Jaf3778
    Answered on November 30, 2018 at 11:43 AM
    You mentioned that it would be best to use the iframe code if other things
    were on a given page. All of my pages will only have the Jotform Java embed
    code on them. Should I still consider the iframe OR can I be assured that
    Java embed code is a good long-term solution for my forms on many Wordpress
    pages? Thanks
    ...
  • Profile Image
    Jim_R
    Answered on November 30, 2018 at 01:45 PM

    I strongly recommend you use the platform-specific codes for your website. Since it's powered by WP (either self-hosted with .org or hosted in wp.com), always use the codes intended for your website.

    The only time the iframe embed codes will be useful is if there are script conflicts between your website and ours. If there's none, then the platform-specific embed codes for WP will always be your first choice.

  • Profile Image
    Jaf3778
    Answered on November 30, 2018 at 02:43 PM
    Great! It looks as though the default embed option is the exact same code
    as the wordpress.org recommended code. Will this always be the case? If so,
    it will save me an extra click & many more over time, Thanks
    ...
  • Profile Image
    John_Benson
    Answered on November 30, 2018 at 03:47 PM

    Will this always be the case?

    Short answer, Yes. I hope everything is clear now.

    Feel free to ask us again if you have questions.