Multilingual form is not working on my website

  • arcfotografia
    Asked on May 19, 2015 at 11:52 AM

    Hello.

     

    I have two forms embedded in my website, both with multilingual options.

    One of them works fine. You can use the dropdown menu to change between Portuguese and English and it correctly detects the location and changes the language accordingly.

    The other one only displays the word "Language" but does not allow the user to change languages. It defaults to the English one.

    I´ve checked my settings and they are the same for both forms. All relevant fields are translated.

    I tried multiple times but it does not seem to be working.

    I appreciate your help.

    Thank you

  • BJoanna
    Replied on May 19, 2015 at 1:09 PM

    I have tested your website and I noticed problem you are mentioning. I have also tested your form that is not embedded to the website and I was able to change language between Portuguese and English. 

    I noticed that you are using script block (source code) for embedding your form on website. We recommend  using of iFrame code. You can try to replace script block with iFrame to see if the language drop down menu will work. In this article you can find out how to do it.

    http://www.jotform.com/help/148-Getting-the-Form-iFrame-Code 

    Hope this will help. Let us know if you need further assistance. 

  • arcfotografia
    Replied on May 20, 2015 at 5:38 AM

    Hi BJoanna

    I managed to get it to work using iFrames, but I need to understand why this happened, since the other form is using script block and it works perfectly.

    Please see the other form: http://arcfotografia.com/wedding-details-form/

    The source code was copied straight from the embed code for Wordpress.

    Thank you again

  • Boris
    Replied on May 20, 2015 at 8:01 AM

    Thank you for letting us know, we are glad that you've got it working.

    The difference is that the form which works, the contact form, is already embedded as an iFrame embed. Please look at the image:

    Multilingual form is not working on my website Image 1 Screenshot 30

     

    The page where the form doesn't work is embedded as a script embed. Please look at the image:

     

    Multilingual form is not working on my website Image 2 Screenshot 41

     

    The reason that the script embedded form doesn't work is that there is a conflict between the scripts on the form and the JQuery script library that is used by your website.

    By using the iFrame, you are sandboxing the form and preventing scripting conflicts between the form and your page.

    I hope this clears up what you wanted to know.

    Please let us know if you need further help, we will be happy to assist you.

  • arcfotografia
    Replied on May 20, 2015 at 8:14 AM

    Hi Boris.

    Thank you for your reply, but the contact form is now working because I followed your advice to use an iframe. It did not work when using script.

    However, the other form I have on my site, which uses script, works perfectly.

    <script src="//form.jotformeu.com/jsform/43352808268359" type="text/javascript"></script>

    My issue is trying to understand why one of them works with script (http://arcfotografia.com/wedding-details-form/), and the other only works by using the iframe (http://arcfotografia.com/contact/). That shouldn´t happen.

  • Boris
    Replied on May 20, 2015 at 9:02 AM

    I can clearly see the scripting conflict on the script embedded form, you are probably not noticing it because you already have everything loaded in your browser's cache.

     

    If you would like to see the conflict in action on the script embedded form, where you will not be able to change the language, please open a new Private Window (or Incognito Window, depending on your browser).

    Then, paste the link to the script embedded page and go to the page. http://arcfotografia.com/wedding-details-form/

    After the initial load, you will not be able to change the language, due to the scripting conflict.

    Now that the scripts are loaded into your cache, you can simply reload the page and the language changing will work from now on.

     

    For best experience, of both you and your website visitors, I would recommend that you use iFrame embed method for all the forms - to avoid these scripting conflicts. Your visitors that have just landed on your page do not already have the scripts loaded in their cache, so the form will not work properly for them.

    I hope that it is clearer now - the script embedded form only appears working for you because your scripts are already loaded in your cache and they get to execute before the conflict. For new users, the conflict is apparent on the script embedded form. The iFrame embedded form has no such conflicts, and it works for everybody.

    Kind regards.

  • arcfotografia
    Replied on May 20, 2015 at 9:19 AM

    Boris, you´re right.

    Because I never saw the error on the original form, I never realised it was in conflict.

    I have now changed the code to use an iframe on both forms.

    Thank you again for your help.

  • Boris
    Replied on May 20, 2015 at 9:30 AM

    You are kindly welcome. :)

    Thank you for letting us know.

    Have a nice day.