cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

On button select set radio button to pick one selection

I have 4 buttons, lets say button 1, 2,3 & 4, and a radio that has 4 options to chose from that will correspond to those buttons so 4 choices  A,B,C & D called CMITYPE.  What I would like to do is is on click of button 1 that the radio shows selection of A if I click on button 2 radio B selects etc.  What is the easiest way to go about this?  TY for the help.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: On button select set radio button to pick one selection

Quick and easy answer is:

 

In the OnSelect of each button:

   Button 1 OnSelect -  UpdateContext({OptChoice:"A"})

   Button 1 OnSelect -  UpdateContext({OptChoice:"B"})

   Button 1 OnSelect -  UpdateContext({OptChoice:"C"})

   Button 1 OnSelect -  UpdateContext({OptChoice:"D"})

 

In the Default property of the Radio control:

   OptChoice

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

4 REPLIES 4
Highlighted
Super User
Super User

Re: On button select set radio button to pick one selection

Quick and easy answer is:

 

In the OnSelect of each button:

   Button 1 OnSelect -  UpdateContext({OptChoice:"A"})

   Button 1 OnSelect -  UpdateContext({OptChoice:"B"})

   Button 1 OnSelect -  UpdateContext({OptChoice:"C"})

   Button 1 OnSelect -  UpdateContext({OptChoice:"D"})

 

In the Default property of the Radio control:

   OptChoice

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Highlighted
Resolver I
Resolver I

Re: On button select set radio button to pick one selection

Quick and easy i like ty...worked like a charm but annoyingly does not save to sharepoint where the info is being stored unless a user manually makes the selection, super frustrating.  So even though when i click the button A is selected in the radio list, once form is submitted it shows that row cell as blank, on the other hand if i then change to a different selection and back to A or just manually enter the selection it shows A B C or D.

Highlighted
Resolver I
Resolver I

Re: On button select set radio button to pick one selection

So my follow up issue with the radio button not saving to sharepoint, I moved the patch() command to the button itself instead of the radio button and for whatever reason this way worked.

Highlighted
Super User
Super User

Re: On button select set radio button to pick one selection

Yes, you would need to put the update/patch logic somewhere.  I would have said the button would be the best place. When you start "automating" the default on another control and then use OnChange or OnCheck or OnUncheck, you can get yourself into a situation where things get fired off in a way you didn't expect.  The button is the good choice.  However...if the user would also be checking/unchecking the radio control as well as possibly the button, then you will need to consider putting the update/patch logic in the OnChange event.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,881)