Skip to main content
Inspiring
May 12, 2021
Answered

How can I refer to individual Radio Buttons that belong to different groups?

  • May 12, 2021
  • 2 replies
  • 3523 views

Hi everyone!!

 

I need the user to select two Radio Buttons, each one in a group, before a dialog box pops up.

I know how to select and trigger actions from Radio Buttons in the same group, but how can I

do that when they are in different groups? 

 

Thanks a lot for your help!!

This topic has been closed for replies.
Correct answer Nesa Nurani

You call dialog box from radio buttons action and you want to call it when combination of two of them are checked?

lets say you have "Group1" and "Group2" both group with  choices of "Choice1" and "Choice2" and lets say you want to call dialog box only if both "Choice1" are selected, as Mouse up event of both buttons you can use something like this:

if(this.getField("Group1").value == "Choice1" && this.getField("Group2").value == "Choice1")
//code for dialog box goes here

2 replies

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
May 12, 2021

You call dialog box from radio buttons action and you want to call it when combination of two of them are checked?

lets say you have "Group1" and "Group2" both group with  choices of "Choice1" and "Choice2" and lets say you want to call dialog box only if both "Choice1" are selected, as Mouse up event of both buttons you can use something like this:

if(this.getField("Group1").value == "Choice1" && this.getField("Group2").value == "Choice1")
//code for dialog box goes here

Inspiring
May 12, 2021

Thanks a lot for your help, Ms. Nurani!

It was really helpful, as usual.

Cheers!

 

try67
Community Expert
Community Expert
May 12, 2021

I would use the calculation event of a (hidden) text field to do it.

You can check the values of both groups, and if the two values you're interested in are selected then show the dialog.

Inspiring
May 12, 2021

Really? I cannot access the values of the radio buttons individually? Well, thanks a lot for the information, but can you show me what the code for this instruction would look like? I never used the calculation event before.

 

Thans a lot for your help.

try67
Community Expert
Community Expert
May 12, 2021

Radio-buttons don't have an individual value, only the group does. They have export values, which is the value that the group has if they are selected. It's the same for check-boxes, although there you can have a group with just a single widget, which is not usually done with radio-buttons (although it is possible).