如何验证PDF表单?
我有一个用 Acrobat Professional 制作的可写 PDF 表单。我想验证数字条目是否在特定范围 [a,b] 内。如果不是,我希望弹出一条警报,其中包含以下消息:“请通过 XXX-XXX-XXXX 联系 Larry 以处理您的表单。”有人可以编写一段快速的代码来为 PDF 执行此操作吗?我知道如何为网络表单做到这一点。
I have a writeable PDF form made in Acrobat Professional. I want to validate that a numerical entry is in a certain range [a,b]. If it is not, I want an alert to pop up with the message, "Please contact Larry at XXX-XXX-XXXX to get your form processed." Can someone write up a quick snippet of code that does this for a PDF? I know how to do it for a web form.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以执行以下操作:
您可以通过编辑字段的属性来输入此验证脚本。转到“验证选项卡”,单击“运行自定义验证脚本”,然后单击“编辑...”。在 JavaScript 编辑器窗口中键入代码,然后单击“确定”和“关闭”。
(来源:skitch.com)
You could do something like this:
You can enter this validation script by editing the properties of a field. Go to "Validate Tab", click "Run custom validation script", then "Edit...". Type the code into the JavaScript Editor window, and then click "Ok" and "Close".
(source: skitch.com)
只要您同意默认错误消息,您就可以在没有 JavaScript 的情况下执行此操作。
数字
现在,当用户尝试提供超出该范围的答案时,弹出框将提醒他们错误。
You can do this without javascript as long as you are OK with the default error message.
Number
Now, when a user tries to supply an answer outside that range, an popup box will alert them to the error.