How to add Multiple Radio Button under each other

Naveen87
Tera Guru

Hey Guys,

I have a requirement , Where i have to field == Desk phone.

When Desk phone is selected , 2 radio buttons should be appear. A and B.

When A is selected , it will have C and D under it.

find_real_file.png

How to achieve this??

 

 

Please suggest.

Thank you

1 ACCEPTED SOLUTION

I've done as below:

find_real_file.png

find_real_file.png

find_real_file.png

View solution in original post

30 REPLIES 30

Hitoshi Ozawa
Giga Sage
Giga Sage

How about aligning radio buttons horizontally and dynamically displaying 2nd tier radio buttons based on the first tier?

Choice 1 selected

find_real_file.png

--------------------------------------------------

Choice 2 selected

find_real_file.png

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }

    switch (newValue) {
        case 'choice_1':
            g_form.setDisplay('radio_button2_1', true);
            g_form.setDisplay('radio_button2_2', false);
            g_form.setDisplay('radio_button2_3', false);
            break;
        case 'choice_2':
            g_form.setDisplay('radio_button2_1', false);
            g_form.setDisplay('radio_button2_2', true);
            g_form.setDisplay('radio_button2_3', false);
            break;
        case 'choice_3':
            g_form.setDisplay('radio_button2_1', false);
            g_form.setDisplay('radio_button2_2', false);
            g_form.setDisplay('radio_button2_3', true);
            break;
    }

}

Hi Hozawa,

 

Thank u so much for this idea.

 

Can u plz suggest how can i add info msg or anything sort of msg when Radio 1 and choice 1 is selected..


Ex:- When New Hire is selected,

If New Hire, state that accessories are included (Two Monitors, Cables,
Keyboard and Mouse) should be visible.
 
find_real_file.png
 
 

How about having defining set of labels under the 2nd tier radio button and doing setDisplay() on these labels based on selection.

e.g.

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }
    switch (newValue) {
        case 'radio_button2_1_choice1':
            g_form.setDisplay('message1', true);
            g_form.setDisplay('message2', false);
            break;
        case 'radio_button2_1_choice2':
            g_form.setDisplay('message1', false);
            g_form.setDisplay('message2', true);
            break;
    }
}

I tried this but isn't working.

Correct me if i'm doing something wrong.

find_real_file.png

 

find_real_file.png

onChange on variable "Option" 

switch(newValue){