Infopath 2007 - 如何仅对当前视图执行数据验证?
我正在开发一个 infopath 2007 表单,它使用 3 个不同的视图。
3 个不同的视图基本上具有相同的形式,但显示不同的文本框,具体取决于用户选择的按钮。 我遇到一个问题,“视图 1”有一些表单验证,但用户选择了“视图 2”并提交了它。 触发“视图 1”上的表单验证,用户无法提交表单。 如果用户当前正在提交“视图 2”,如何忽略“视图 1”上的表单验证?
I have an infopath 2007 form that I am developing which uses 3 different views.
The 3 different views are basically the same form, but have different text boxes shown, depending upon what button the user selects.
I run into a problem where 'view 1' has some form validation, but the user has selected 'view 2' and submits it. The form validation on 'view 1' is triggered, and the user cannot submit the form.
How can I ignore the form validation on 'view 1' if the user is currently submitting 'view 2'?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要使用数据验证规则,而不是勾选标准的“此字段不能为空”复选框(例如)。 假设您有两个视图,每个视图中都有一个不能为空的文本框,但您只想强制执行当前视图。 以下是表单的结构:
fields:
text2(文本)
视图1(默认)
text1 - 规则:if(currentView = 1 AND text1为空)显示“不能为空”
button1 - 操作:设置字段值(currentView = 2); 切换视图(到 2)
视图 2:
text2 - 规则:if (currentView = 2 AND text2 为空) 显示“不能为空”
button2 - 操作:设置字段值 (currentView = 1); 切换视图(至 1)
有意义吗?
奥辛
Rather than tick the standard "this field cannot be blank" checkbox (for example), you need to use the Data Validation rules instead. Lets say you have two views with a textbox in each that cannot be blank, but you want to only enforce the current view. Here's the structure of the form:
fields:
text2 (text)
view 1 ( default)
text1 - rule: if (currentView = 1 AND text1 is blank) show "cannot be blank"
button1 - action: set a fields value (currentView = 2); switch views (to 2)
view 2:
text2 - rule: if (currentView = 2 AND text2 is blank) show "cannot be blank"
button2 - action: set a fields value (currentView = 1); switch views (to 1)
Make sense?
Oisin