Re: How to set a conditional requirement depending on choice, e.g. radiobutton or checkbox

Posted by Alessandro Vernet on
URL: https://discuss.orbeon.com/How-to-set-a-conditional-requirement-depending-on-choice-e-g-radiobutton-or-checkbox-tp4665615p4665627.html

Hi Vlad,


czajw wrote
> How to make a section or control required when it is visible after
> selecting a radiobutton / checkbox, and how to make a required section or
> control disappear when the section / control is not visible?

You cannot make sections required; only fields can be required. So you could
make every field required, without the condition, and if that field is not
visible, then the "required" constraint won't apply (as users wouldn't have
a way to provide a value if the field is not visible). And you'll let me
know if I somehow misunderstood your question (if so, maybe an example would
help).


czajw wrote
> And besides  - How to set in grid / repeated grid, If one field in the
> line
> is filled (no matter what), fill in the others (then they should be
> required)  

Say you have controls `a`, `b`, `c`, then for `a` you would say that it is
required if: `xxf:non-blank($b) or `xxf:non-blank($c)`. And you write a
similar expression for controls `b` and `c`.

-Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1611533712984-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet