英文:
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.
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个单选框字段,分别命名为a
、b
和c
。处理这种情况的一种方法是在每个字段上使用以下验证规则:
$a/string() = 'true' or
$b/string() = 'true' or
$c/string() = 'true'
这将产生以下结果:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论