1
0
-1

I would like to create a cascading radio button with 'How many fault claims in the last 3 years/ How many of these last 1 year?

Eg : How many fault claims in the last 3 years have 0,1,2,3,4 5+ buttons. 

If I select 2, I have a new radio button (how many of these fault claims in the last 1 year) with 0 ,1 and 2 as the options. 

 

  1. Ben Warner

    And I assume if they select 3 then you want options of 0, 1, 2 and 3 for the second question? Same for 4 and 5+?

  2. Ramya Dixit

    Yes, that is right.

CommentAdd your comment...

1 answer

  1.  
    1
    0
    -1

     

    1. Add your first question as a standard radio button group with options 0, 1, 2, 3, 4, 5+.
    2. Add a data field called Claims In Year Options.
    3. Add a Data Driven Radio Group and point the Data Source to the data field you created above:
    4. Add a visibility rule to the second question so it only shows when relevant with script something like this:
      data.claims3Years !== "" && data.claims3Years !== "0" 
    5. Now on question 1 add a Change rule to set the values in the second question dynamically:
    data.claims1Year = "";
    var options = "";
    switch(data.claims3Years) {
      case "1":
        options = "0,1";
        break;
      case "2":
        options = "0,1,2";
        break;
      case "3":
        options = "0,1,2,3";
        break;
      case "4":
        options = "0,1,2,3,4";
        break;
      case "5+":
        options = "0,1,2,3,4,5+";
        break;
    }
    data.claimsInYearOptions = Calc.delimitedSelection(options);

    Note that your field Ids may differ.

     

    Format the appearance of the radios as you please and it should behave something like this:

     

      CommentAdd your comment...