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

42 views
Skip to first unread message

Władysław Czaja

unread,
Jan 22, 2021, 1:58:23 AM1/22/21
to Orbeon Forms
Hi all, 

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? 

Vlad

Władysław Czaja

unread,
Jan 22, 2021, 5:05:50 AM1/22/21
to Orbeon Forms
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)  

Alessandro Vernet

unread,
Jan 24, 2021, 7:15:14 PM1/24/21
to orb...@googlegroups.com
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/

Alessandro Vernet

unread,
Feb 1, 2021, 1:06:13 AM2/1/21
to orb...@googlegroups.com
Hi Vlad, if you got a chance to work on this one, have you managed to what
you were looking for with required/visible fields, maybe based on the
suggestion in my previous message?
Reply all
Reply to author
Forward
0 new messages