PDA

View Full Version : Enabling\Disabling a radio button



atulmaurya
11-25-2011, 12:31 AM
Hi,

I have two choice groups on a panel say G1 and G2. in each group there are two radio buttons yes and No (G1- Yes/No and G2- Yes/No). Now I want to enable/disable radio button Yes based on the choice made in G1. For example- If the user selects "Yes" in G1, the "No" radio button in G2 should be disabled and if the user selects "No" in G1, The "No" button in G2 should be selected by default.


Thanks and regards
Atul

SunnyBoy
11-25-2011, 01:24 AM
Hello Atul,

Kindly follow the below steps
1.Go to Pre install tab.
2.Click on Add Action.
3.Add Get User input: Advanced panel.
4.Click on the properties of the Get user input: Advanced panel.
5.Select the General settings tab.
6.click on Add Choice Group.
7.Double click on the choice group added, a pop up window opens.
8.Select the component type as "Radio Buttons".
9.In the Configure components tab, click on "sub components".
10.Now add one choice groups and select the component type as "radio button".

Regards
SunnyBoy

Macintosh
11-25-2011, 04:38 AM
As far as I understand achieving – “If the user selects "Yes" in G1, the "No" radio button in G2 should be disabled and if the user selects "No" in G1, then "No" button in G2 should be selected by default” is not possible if you would like this functionality with single “Get User Input” panel.

If you can divide it in two panels then that might be possible using below mentioned steps. Example –

1. Get User Input Panel – CG1 – RB(Yes) - User_Input_Var_1
RB(No) - User_Input_Var_2

2. Use Set InstallAnywhere variable –Multiple Variables Actions
User_Input_Var_3 = User_Input_Var_1
User_Input_Var_4 = User_Input_Var_2

4. Get User Input Panel – CG2 – RB(Yes) - User_Input_Var_3
RB(No) - User_Input_Var_4


The above configuration would provide – “If the user selects "Yes" in G1, the “Yes” radio button in G2 should be selected and if the user selects "No" in G1, then "No" button in G2 should be selected by default" as the result.

--Mac

atulmaurya
11-25-2011, 05:25 AM
Thank you Mac and SunnyBoy for your quick responses.

I am planning to do this in following way:

1.Group1.
"Yes" will have a single nested radio button "Yes" (USER_INPUT_X) of CG2

2. Group1.

"No" will have both (Yes and No) the radio buttons of Group2 as nested elements.
"Yes"- USER_INPUT_X (same variabe name as in the case of "Yes" in G1)
"No" - USER_INPUT_Y

in IA we have the choice to hide the input variables. So the user will see the nested elements only of the selected radio button.