If I have a radio button with three options A, B, C and I have an input field that the relevancy depends on if the radio button has the value A. Then: If I select the value A in the radio button, the input field is visible and I can add a value. BUT when I change the radio button to B, the Input field is hidden but the value is still there (if I select A again, I can see the value)
Is it possible to remove the value by an event?
Best How To :
The simplest is to reset the value with a
calculate, which you can place in the same
xf:bind you use to hide the input when the value B is select, as done in the example below. For forms created with Form Builder, there is an RFE for this behavior to be implemented out-of-the-box, but reseting the value only on save/submit, so if you switch back and forth between A and B, the value in the input wouldn't be lost, but it is cleared when the form is saved/submitted.
relevant="../select1 = 'A'"
calculate="if (../select1 = 'A') then . else ''"
<xf:select1 appearance="full" ref="select1">