cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
polska2180
Level: Powered On

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.
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.
polska2180
Level: Powered On

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.

polska2180
Level: Powered On

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.

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.