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

    Trigger conditions according to the country where the form is opened

    Asked by bhanukaran on September 05, 2013 at 03:20 AM

    Hi Team,

    Since, we are doing mulit-country contest using your Jotform in Middle East. We have 5 countries which includes Saudi Arabia.

    Saudi is very particular about the language that they speak and read. Hence, we want to know if i can set my radio buttons in such as way that if the form opens in Saudi Arabia then should automaticall toggle to Arabic instead of having it in english by default. 

    How can i achieve this using Jotform.

    Here is the link of the form that we integrated using the js file downloaded from Jotform.

     

    Kindly suggest.

    Thanks

    Bhanu

    Page URL:
    http://beta.shukranrewards.com/homecentre_roommakeover/new_design.html

    form visibility JotForm radio buttons integrated thanks
  • Profile Image
    JotForm Support

    Answered by EltonCris on September 05, 2013 at 05:27 AM

    Hi Bhanu,

    That's not possible unfortunately. That's pretty beyond in our form builder. We do not have such function. You may however use custom source code and use 3rd party scripts that detects IP/Country so you can trigger conditions depending on what country your form is opened.

    This might help: http://jquery-plugins.net/jqIpLocation/jqIpLocation.html

    Thanks!

  • Profile Image

    Answered by bhanukaran on September 05, 2013 at 05:35 AM

    Thanks Elton. 

    So just to summarize again, if i am using your javascript code to do custom can i add this custom javascript code on your form to do it right ?

    Please confirm if it is do-able??

    Thanks

    Bhanu

  • Profile Image
    JotForm Support

    Answered by guilledutra on September 05, 2013 at 09:16 AM

    Hi,

    you will be able to achieve what you are looking for using the jquery plugin provided by @EltonCris. You can paste a copy of that plugin inside the "js" folder at your form's source code, then  link it using the <script> tags inside the HTML downloaded within the formś source code.

    Thanks

  • Profile Image
    JotForm Support

    Answered by EltonCris on September 05, 2013 at 12:28 PM

    @Bhanu

    Here I came up with another script that detects the country and auto-check the appropriate radio language option.

    <script language="JavaScript" src="//www.geoplugin.net/javascript.gp" type="text/javascript"></script>

    <script language="Javascript"> 

    var country = geoplugin_countryCode();

    if (country === 'SA') {

        //if country is saudi change language to Arabic

        document.getElementById('input_21_0').checked = false;

    document.getElementById('input_21_1').checked = true;

    } else {

        //otherwise default to English

    document.getElementById('input_21_0').checked = true;

    document.getElementById('input_21_1').checked = false;

        }

      </script>

    Just add this at the bottom part of your form source code right before the ending </body> tag.

    Hope this helps. Thanks!

  • Profile Image

    Answered by bhanukaran on September 05, 2013 at 04:18 PM

    Thanks for the support. Will this script work on Secured forms or the server which has SSL certificates.

    Kindly suggest. As we have been using secured form version of Jotform

    Thanks

    Bhanu

  • Profile Image
    JotForm Support

    Answered by Mike_T on September 05, 2013 at 05:56 PM

    They provide the SSL version of their location checker for €12 per year.

    http://www.geoplugin.com/premium#ssl_access_per_year

    And usage:

    http://www.geoplugin.com/webservices/ssl

    So script will be like:

    <script language="JavaScript" src="https://ssl.geoplugin.net/json.gp?k=<YOUR_KEY>" type="text/javascript"></script>

    <script language="Javascript">

    var country = geoplugin_countryCode();

    if (country === 'SA') {

    //if country is saudi change language to Arabic

    document.getElementById('input_21_0').checked = false;

    document.getElementById('input_21_1').checked = true;

    } else {

    //otherwise default to English

    document.getElementById('input_21_0').checked = true;

    document.getElementById('input_21_1').checked = false;

    }

    </script>

    You should be able to use it along with our secure form source code.

  • Profile Image

    Answered by bhanukaran on September 08, 2013 at 03:10 AM

    Thanks a lot for all the help provided by you guys. We are going ahead with your solution as it works for us really well.

    Bhanu

  • Profile Image
    JotForm Support

    Answered by EltonCris on September 08, 2013 at 03:22 AM

    That's great to hear. Cheers!