列出 Orbeon 表单中所有无效控件

发布于 12-05 11:29 字数 208 浏览 5 评论 0原文

我的表单中有 30 个字段。在表单的底部有一个按钮,如果单击它,它应该显示所有无效的字段。无效还包括未填写必填字段。

使用xforms:trigger我可以创建一个按钮,使用DOMActivate甚至我可以编写xforms:action。但是我应该在 xforms:action 中写什么来列出所有无效字段。

I have 30 fields in my form. At the bottom of the form I have a button where if I click on it, it should display all the fields which are invalid. Invalid includes not filling the mandatory fields also.

Using xforms:trigger I can create a button and using DOMActivate even I can write xforms:action. But what should I write inside the xforms:action to list all invalid fields.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

和我恋爱吧2024-12-12 11:29:13

您可以通过侦听 xforms-validxforms-invalid 等事件来实现自己的错误摘要,跟踪哪些控件有效和无效。但这不是一项简单的任务,特别是如果您想处理重复,甚至嵌套重复。幸运的是,这项工作已经为您完成,并且代码已放入可重用组件中:

如果您使用 Form Runner,则默认情况下会为您设置错误摘要。否则,请参阅此文档,了解如何使用错误摘要组件。

You can implement your own error summary by listening to events like xforms-valid and xforms-invalid, keeping track of which controls are valid and invalid. But this is not a trivial task, especially if you want to handle repeats, and even nested repeats. Fortunately, this work has been done already for you, and the code has been put in a reusable component: <fr:error-summary>.

If you are using Form Runner, the error summary is setup for you by default. Otherwise, see this documentation on how to use the error summary component.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文