Can't make radio button selection when condition is added

  • Alertforce_AU
    Asked on April 9, 2016 at 9:23 PM

    I have a radio button question in a form to which I have added a set of conditions so that when the user selects a button it replaces the text from the radio button with a number. This is because I am then passing the answers into another external database VIA API which requires the data to be in num format rather than text.  

    However, once I activate this condition and try to test the form, I am not able to make any selection from the radio buttons. I've searched the forums but cant find any clues.

    1) Can please give me a hint as to why this wont work?

    2) Is there an easier way to achieve mapping a set of answer selections to associated numbers or other criteria?

    Thanks

    Jeremy

    Jotform Thread 814691 Screenshot
  • Mike_G JotForm Support
    Replied on April 10, 2016 at 6:47 AM

    If I understand your concern correctly and if what I understand base from the conditions on your form is correct, I believe what you need to do is set a calculation value for your radio button field.

    How-to-Assign-Calculation-Value

    Cant make radio button selection when condition is added Image 1 Screenshot 40

    Then, add a Form Calculation widget to your form that will hold the value of the option from the radio button being selected. Set the Form Calculation widget to hidden so it will not show on your form. Then the value that you need to pass to your external database is the value that's held in the Form Calculation widget.

    Cant make radio button selection when condition is added Image 2 Screenshot 51

    Here's how it works:

    Note: I have to disable all the conditions affecting the radio button fields to show you how it works. The conditions you set on your form, actually, creates conflict that is why it doesn't allow you to make any selection at all. Also, I have shown the Form Calculation for testing purposes only.

    Cant make radio button selection when condition is added Image 3 Screenshot 62

    You just have to do the same to all of the other radio button fields in your form.

    I hope this helps, otherwise, please let us know. Thank you.

  • Alertforce_AU
    Replied on April 12, 2016 at 7:46 AM

    Hi Mike,

    Thanks for your response. It was really helpful and I have constructed all the calculated fields using this method.

    It has left me however with one issue. There is one instance where we have used the output of one field that is dropdown (Course selected) defines the options available for the course date instance fields. The approach I have taken is to have three similar fields with course dates corresponding to the selection of the course. If I select course type 1 then course dates field for course type 1 is displayed and the course date fields for types 2 and 3 are hidden. I repeat this for the other course types and their corresponding dates. The calculation widget then takes the selected course date and converts it into the corresponding course ID number which I have manually entered into the course calculations box in the field settings.

    The problem I am having is that if I select one course and select a date it calculates the corresponding value and puts it into the calculation field. But then if I go and change the course selection and select another date, it iinserts this second value after the first date value and and so on for as many values as I select.

    This is breaking my API integration at the other end because I have to many characters in the field.

    Is there a way to clear the field if the user changes their selection?

    Thanks

    Jeremy

  • Carina
    Replied on April 12, 2016 at 9:47 AM

    I will make further tests and will let you know as soon as I have more results.

    Let us know if we can assist you further.   

  • Carina
    Replied on April 12, 2016 at 10:57 AM

    Unfortunately I could not locate calculation fields in the form you mention. Please let us know the form's url so we can perform further tests.

     I created a test form and added values to the dropdown fields:

    Cant make radio button selection when condition is added Image 1 Screenshot 20

    It is important to add 0 to the first option as it will be the value on the unselected option.

    You can test and clone the demo form:  

    https://eu.jotform.com/61023845298964 

    Let us know if we can assist you further.   

  • Alertforce_AU
    Replied on April 12, 2016 at 11:08 AM

    The form's URL is https://form.jotform.co/61010871708854

    The field that is selecting the course is Name of Certificate course

    It has three options. These options are then used to display or hide the relevant Course Date field of which there are three. The value of the course date field is then used in the calculation of the value of field Course Date Instance which is one of the hidden calculation fields that are being used to change the value of the selection where the data type needs to be different to be accepted by another registration database that has compliance settings. Data is being pushed by zapier from Jotform to Infusionsoft and then via API from Infusionsoft into the final database.

    If you can tell me how I can clear Course Date Instance each time a new entry comes in that would help me.

    I need to do this for another field as well.

    Thx,

    Jeremy

    Note: I didnt add 0 as the first field in some cases because these are mandatory fields so they have to be selected before the form is submitted.

  • David JotForm Support
    Replied on April 12, 2016 at 12:37 PM

    In your form preferences, under the advanced tab, click on "Show More":

    Cant make radio button selection when condition is added Image 1 Screenshot 20

    From the addition options, change "Clear Hidden Field Values" to "Clear On Being Hidden".  This will clear the value for the date field each time one of the date fields is hidden.

  • Jeremy
    Replied on April 12, 2016 at 7:33 PM

    Did you test this?

    I believe that this solution will not work as the field that is holding the calculation is permenantly hidden rather than being hidden and unhidden.

    can u think of another method that will work? Perhaps   fields 

    Jeremy

  • Chriistian Jotform Support
    Replied on April 12, 2016 at 10:57 PM

    I checked your form and I see that the calculation field holding the value from the "Course Date" is the "Course Date Instance", which is now visible. 

    It appears that the form is working properly, as when I select an option from the Course Date, then choose another option, the value from the "Course Date Instance" is being replaced instead of simply being inserted to the first value.

    Cant make radio button selection when condition is added Image 1 Screenshot 20

    By setting the preference to "Clear on being hidden" the value based on the condition from the Course Date and Course Date Instance will be cleared once the course date is hidden, so the value from the newly selected option will replace the old one in the Course Date Instance.

    If you need further assistance with your form, please let us know.
    Regards.