How can I count the options selected in radiobuttons?

  • Edanguz
    Asked on October 13, 2017 at 1:27 PM

    I have a form with many questions and 3 specific options for the questions; when I clic in the SEND button, create a PDF in my google drive with the information.

    I want to count

    How many "yes" options selected

    How many "no" options selected

    How many "maybe" options selected 

    And print in the PDF.

     

    Jotform Thread 1272837 Screenshot
  • David JotForm Support
    Replied on October 13, 2017 at 2:44 PM

    For this, I would recommend using an input table field:

    1507919446Capture Screenshot 10

    Assign calculation values to the options in the table:

    https://www.jotform.com/help/301-How-to-Assign-Calculation-Value

    A value of 1 for each option will work for your purposes.

    Then use calculation widgets to total up the choices for each:

    https://www.jotform.com/help/414-Calculate-Values-in-the-Input-Table-Through-Condition

    Here is an example form to show how it would work:

    https://form.jotform.com/72855636052965

  • Edanguz
    Replied on October 13, 2017 at 3:18 PM

    wow thanks, but you are using check box; it can't with radiobutton?

  • David JotForm Support
    Replied on October 13, 2017 at 3:25 PM

    It can be radio button but when using calculations on input tables, radio buttons cannot add up specific columns.  I can think of other workarounds you could use but they would like involve adding quite a bit more fields to the form and setting up several conditional statements.  Something like adding a number field per option in the form, then conditionally updating those fields. 


  • David JotForm Support
    Replied on October 13, 2017 at 3:25 PM

    It can be radio button but when using calculations on input tables, radio buttons cannot add up specific columns.  I can think of other workarounds you could use but they would like involve adding quite a bit more fields to the form and setting up several conditional statements.  Something like adding a number field per option in the form, then conditionally updating those fields. 


  • Edanguz
    Replied on October 13, 2017 at 3:33 PM

    ok I don`t know how to do that; where can I read about that.

    Thanks.

  • David JotForm Support
    Replied on October 13, 2017 at 3:45 PM

    For that setup, add a number field for each one of your field options:

    1507923412Capture Screenshot 10

    Then, set up a condition for each option to update the number field with a 1 if the option is selected:

    https://www.jotform.com/help/268-How-to-Insert-Text-or-Mathematical-Calculation-into-a-Field-Using-a-Condition

    1507923502Capture1 Screenshot 21

    1507923598Capture2 Screenshot 32

    You can then add up those fields using a calculation field:

    https://www.jotform.com/help/259-How-to-perform-calculation-in-the-form

    I set up the first couple fields in my test for to show how it would work:

    https://form.jotform.com/72855636052965

    You can clone the form to your account if you would like:

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