Clear Selected Radio Group Button
I have a Radio Group form element where the buttons and their values change depending on several other form elements. If at any point the user makes a selection in the radio group, then changes one of the other triggering form elements, the new set of radio group buttons always has one that is selected, despite them completely different options from when the initial radio button was selected.
Is there a way to clear all the buttons, so each time the values change nothing is selected?
-
Hi Carl,
You could use the Set Current Form Element Item activity for each of the different form elements. To reset a Radio Group to the default, you would use an index of 0.
Thanks, Stefan
0 -
No @Stefan Schweigert? , it doesn't work.
0 -
Hi Carl and Guillaume,
What client application are you currently using? When I run a workflow in the Sandbox or through GVH, I see the RadioButton become unselected when the parent form element changes.
Thanks, Stefan
0 -
@Stefan Schweigert? Could you post an example? I am trying to change the selection of a radio button group based on the event in another radio button group selection and nothing I have tried has worked yet. Probably something obvious.
--Marc
0 -
Hi Marc,
See the attached workflow which uses the Set Current Form Element Item activity to set the selected index within the form. In this case, it sets the index to -1, which clears the form each time that the workflow is loaded.
To select another group's items, change the Element to something like =$displayform2.state.RadioGroup2 and input the index to select.
Thanks, Stefan
0 -
Hi Stefan,
Ah, I was stuck on the Set Current Form Element Item activity being only for the current element that triggered the event, vs another element in the form. That worked for me then. Thanks!
--Marc
0 -
Actually, with a bit more testing it looks like it is not possible to clear all radio buttons in a radio button group with the Set Current Form Element Item activity after the form has loaded. You can change a selected value, but by its nature, a radio button group expects one selected value and won't deselect all. I tried setting the index value to -1, some index outside the range or null and nothing clears it.
My use case had been to insert nested inputs in the radio button group list so if a user selects a radio button option, specific details would open in the form between the other radio button options, or in my case each radio button group just had one option in order to place the content in between each radio button option.
Looks like I will need to keep the radio button group above the additional details and toggle the view accordingly.
--Marc
0 -
Hi Marc,
I tried as well to clear the settings of the group using the 'current' property, which is also set when a radio button is clicked but couldn't get it to work.
I think the best option would be to create an Idea for a 'Reset' or 'Clear' Form Element activity as this would probably be best handled programmatically rather than setting values to '-1' or 'undefined'.
Thanks, Stefan
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
8 kommentarer