最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Validating PDF form fields before printing - Stack Overflow

programmeradmin1浏览0评论

I have a fillable PDF form that I would like to validate before the user prints it out.

Here is my form:

.pdf

I've looked online for a simple solution and I think I've found it. It is here:

.pdf

I've looked at its field and button properties, but for the life of me I cannot figure out how it works. There is one line of code attached to the button behaviour and that's it.

Can someone tell me what I'm missing to put the same validation function in this form into mine?

Pete

I have a fillable PDF form that I would like to validate before the user prints it out.

Here is my form:

http://www.pentco./orderforms/pentco_creditapp_v2011b.pdf

I've looked online for a simple solution and I think I've found it. It is here:

http://www.alqemy./Forms/RequiredFields.pdf

I've looked at its field and button properties, but for the life of me I cannot figure out how it works. There is one line of code attached to the button behaviour and that's it.

Can someone tell me what I'm missing to put the same validation function in this form into mine?

Pete

Share Improve this question asked Feb 16, 2011 at 17:43 NeuwbsNeuwbs 371 gold badge1 silver badge7 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

The validateFields() method (used on button's mouse up event) is defined at document level. With Acrobat select 'Edit All JavaScripts' menu item and you will see the code for this method. It can be reused very easy, you just have to set tooltips for all required fields and these tooltips must end with '*' (this is how the method determines if a field is required).

This worked perfect...thanks for pointing out where to find that JavaScript. If others are confused:

You need to be in form edit

Then you go to Advanced-->Document Processing-->Edit All Javascript...

You will find the Validation code there. You want to copy it and add it to your print button's Javascript

发布评论

评论列表(0)

  1. 暂无评论