Automatically change Radio Button Labels from Spreadsheets

  • Profile Image
    togaf
    Asked on July 31, 2018 at 09:30 AM

    Hi,

    We use our JotForms for trainees to enroll for our training courses. Our company offers two types of training in three countries. So this adds up to six different training courses and thus the dates and locations of each training option differ.

    Instead of having to change the dates and locations in six forms seperately, we would like to store this date and location data in one central place, preferably a spreadsheet (or maybe a hidden Jotform?). We are currently using radio buttons, but we haven't found a way to change the labels of those radio buttons based on external data. See the attached image for a visual representation.

    I'm aware that there is a Spreadsheet-to-Form widget, but it seems that that module only allows to fill in existing radio buttons, not actually create new radio buttons.

    Is there a way to achieve this?

    Thanks in advance! :)

    Screenshot
  • Profile Image
    roneet
    Answered on July 31, 2018 at 12:39 PM

    Yes, this is possible both ways adding Radiobuttons fields to your form or with Spreadsheet to Form widget. The easier would be adding Radiobuttons fields and manipulate it conditionally.

    I have made a demo form on this. Please feel free to clone and test it.

    https://form.jotform.com/82114928847970

    Refer this guide to clone form from URL:

    https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL

    I would suggest you check the next few guides:

    Smart Forms Using Conditional Logic

    Hide or Show Multiple Fields at Once

  • Profile Image
    togaf
    Answered on August 02, 2018 at 04:12 AM

    Hi,

    First of all, thank you for your answer.


    I think we are getting closer to a workable solution for us. Since the different pages on our website will already determine which country and type of training a visitor prefers, maybe we can prepopulate our forms and hide the prepopulated questions. However, when I tried setting this up, it didn't seem to work. I tried implementing the following code on our website:

    <script type="text/javascript" src="https://form.jotformeu.com/jsform/82131862540350?chooseCountry=Germany&chooseTraining=B">

    The form shows up, but it doesn't preselect Germany and Training Type B. When I just use the following link, it seems to work fine:

    https://form.jotformeu.com/82131862540350?chooseCountry=Germany&chooseTraining=B

    How do I get the javascript to work with prepopulated values?

    NB: https://prepopulate.jotform.io/ seems to be broken? Pressing "Generate URL" doesn't do anything.


  • Profile Image
    ashwin_d
    Answered on August 02, 2018 at 06:59 AM

    In suggest you to please use iFrame embed code instead of script embed code and use the same URL parameter to prepopulate form fields. Please use the following iFrame embed code and see if that solves your problem:


        <iframe

          id="JotFormIFrame-82131862540350"

          onload="window.parent.scrollTo(0,0)"

          allowtransparency="true"

          allowfullscreen="true"

          allow="geolocation; microphone; camera"

          src="https://form.jotformeu.com/82131862540350?chooseCountry=Germany&chooseTraining=B"

          frameborder="0"

          style="width: 1px;

          min-width: 100%;

          height:539px;

          border:none;"

          scrolling="no"

        >

        </iframe>

      Hope this helps. 

    Do get back to us if you have any questions.

  • Profile Image
    togaf
    Answered on August 02, 2018 at 09:12 AM

    Hi, this seemed to do the trick for us, thank you! :)

  • Profile Image
    togaf
    Answered on August 07, 2018 at 08:35 AM

    Hi, when I tried to apply the same method to a new form, I started to run into a weird problem.

    It's about the following form: https://form.jotformeu.com/82181442740351

    The form automatically skips to the second page (Titled: 'Welk trainingstype spreekt u aan?') instead of showing one of the three conditional pages first (Titled: 'Welke datum voor de XXX-training komt u uit?')

    Could you figure out what is causing this behaviour?


  • Profile Image
    roneet
    Answered on August 07, 2018 at 09:54 AM

    To avoid confusion I have moved this question to a new thread. Your question will be addressed to the following thread.

    https://www.jotform.com/answers/1546667

    Thanks.