Multiple validations

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple validations

mbojja
Hi Alex - If there are multiple validations on a field, is there a way to validate in an order and display error messages accordingly instead of displaying all at once?

Thanks

--
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/e463dd58-2040-4c2e-91ca-bee5d3cab89e%40googlegroups.com.

multiple validations.PNG (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Multiple validations

Alessandro  Vernet
Administrator
Hi Manish,

You can't define an order through the UI, but you can do so through your
XPath expressions. Say you have 3 XPath expressions: `a`, `b`, and `c`, then
you can rewrite them as `a` (unchanged), `b and not(a)`, `c and not(a) and
not (b)`. This way, at most one error will show, and if there are multiple
problems, they will show in the order you specified. You'll let me know if
this works for you!

‑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/1587418871720-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Multiple validations

mbojja
Hi Alex - How do we prioritize the validation order of "date of birth" in the attached sample form

Thanks



On Tuesday, April 21, 2020 at 5:41:16 AM UTC+8, Alessandro Vernet wrote:
Hi Manish,

You can't define an order through the UI, but you can do so through your
XPath expressions. Say you have 3 XPath expressions: `a`, `b`, and `c`, then
you can rewrite them as `a` (unchanged), `b and not(a)`, `c and not(a) and
not (b)`. This way, at most one error will show, and if there are multiple
problems, they will show in the order you specified. You'll let me know if
this works for you!

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">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/475205bb-91ad-4769-b6f1-8f2156591778o%40googlegroups.com.

Validation priority (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Multiple validations

Alessandro  Vernet
Administrator
Hi Manish,

Let me elaborate on my earlier example. Say you have three conditions you
want to be true, and for each one a message:

- 1. XPath: x1, message: m1
- 2. XPath: x2, message: m2
- 3. XPath: x3, message: m3

Then, in Form Builder, you enter the following constraints:

1. x1 ⇒ m1
2. x2 and not(x1) ⇒ m2
3. x3 and not(x2) and not (x1) ⇒ m3

This way only one message is shown at any given time, and you can control
the order in which the messages are shown if there are multiple errors.
You'll let me know if this works for you!
‑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/1592547244225-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Multiple validations

Alessandro  Vernet
Administrator
Hi Manish, do the XPath expressions I mentioned make sense? Would this work
in your case?
‑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/1593215437929-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet