Orbeon Forms:检查单选框是否处于活动状态

huangapple go评论91阅读模式
英文:

Orbeon Forms: Check if Single Checkboxes are Active

问题

我们需要多个单选框选项,并为每个单选框提供相应的文本框(请参见此演示表单)。

然而,我们希望在提交表单之前,必须选择其中一个复选框。

我们在验证和警告选项卡中尝试了各种XPath选项,但迄今为止都没有成功。

有什么建议吗?

非常感谢。

PeteA

英文:

We have a requirement to have several single checkbox options with a corresponding text box for each checkbox (see this demo form)

However, we want to stop the form being submitted unless one of these checkboxes has been selected.

Orbeon Forms:检查单选框是否处于活动状态

We have tried various xPath options in the in the Validations & Alerts tab, but we have not had any luck so far.

Any suggestions?

Many thanks

PeteA

答案1

得分: 1

你有3个单选框字段,分别命名为abc。处理这种情况的一种方法是在每个字段上使用以下验证规则:

$a/string() = 'true' or 
$b/string() = 'true' or 
$c/string() = 'true'

这将产生以下结果:

Orbeon Forms:检查单选框是否处于活动状态

英文:

Say you have 3 such Single Checkbox fields, named a, b, and c. One way to handle this is to have, on each of those, the following validation rule:

$a/string() = 'true' or 
$b/string() = 'true' or 
$c/string() = 'true'

This would give:

Orbeon Forms:检查单选框是否处于活动状态

huangapple
  • 本文由 发表于 2023年6月5日 20:54:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/76406618.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定