... w/o having to write a chunk of JS code each time. Is there something built into the Rules Engine to clear a field when it is hidden by a rule? I've searched the Nintex Connect Community for hours
Why would I want to do this you ask?
If a form user fills in a field that becomes irrelevant and is hidden, why would I want to store the irrelevant data?
Don't you just hate people who answer a question with a question?
I've written Custom JS to take care of it, but am hoping there is something built in. A function/method, etc.
Thanks mis amigos!
Solved! Go to Solution.
If you aim to save empty value once field is hidden, add a calculated value connected to the same SP list column as per the fiel and set its visibility rule to the opposite of the field. Keep the calculated value empty so that once field is hidden, calculated value is shown and save empty value to SP list connected column.
*- Make sure to work on visibility from control settings (Expression) so HTML of the field/calculated value is totally removed from the page and thus no save conflict will happen.
Really like this tip but the visibility expression doesn't allow to reference named controls. If I'd use a checkbox to hide the first control I can't check the same checkbox in the visibility expression, right? Or do I miss something?
No intention on saving an empty value one the field is hidden. Why would I do that? I find this answer somewhat strange in that my question had nothing about saving. I asked if there was something built in to clear the field upon being hidden.
Perhaps a little more detail will help. :)
I have a drop down.
In the drop down there is one item that triggers a field to be unhidden.
If for some reason a form user should fill this field in with data and then decide to change their drop down choice, hidding the field they just filled in, I want it to be cleared. The data has become irrelivent as the drop down choice has changed.
As I read my response, I wonder if hidden values are even saved, hmmmmm. I'm gonna do some testing...
unfortunatelly, there is not anything OOTB that would clear hidden controls.
and yes, once hidden controls are connected to list fields they will be saved (sometimes that's very useful ...)
Just tested and the outcome is what I expected.
I selected the choice in the dropdown that shows the field
I filled in the field
Change my choice in the dropdown (thus hiding the field)
Submitted the form
Filed value was submitted
Maybe I'm out on a limb here, but that is not desirable behavior.
Ya, I see where it could be useful (Tabs, Wizards, etc.), however, an option in the field settings would allow either behavior or a method in the Rules Builder.
Oh, well, worth the ask.
would be perfect if you do share your solution to this matter?
I also have 3 choices whereby 2 of them are hidden, depending which option is selected.
If you preselect an option, the value remain the same even if you change to a different option.
How can I clear the selected option IF it has been changed .... ??