Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

Numeric form fields

Question

In the sample pdf pdf_store_order_form are.pdf numeric fields with no input of characters allowed. I can't find the code for this pdf in the samples. How I can do that or can I get the sample code for the creation of this PDF?

Answer

That PDF was created by Adobe Indesign software and is used as a sample of an existing from. The sample is there to show how an existing from with form fields can be filled in.

When you say 'numeric fields with no input of characters allowed' do you mean that it only allows Numeric characters and not Alpha characters. Most of this is performed in the Javascript code.

Here is some information that will help explain how it all works.

Page 118 in the Acrobat Forms API Reference documents all the parameters allowed.

The function FormFieldJavaScriptAction can be used to set the required Javascript actions. For example the 'UnitPrice #1' form field in the pdf_store_order_form.pdf could be set with the following code.

int fIndex = QP.FindFormFieldByTitle("UnitPrice #1");
QP.FormFieldJavaScriptAction(fIndex, "K", "AFNumber_Keystroke(2, 0, 0, 0, \"\\u0024\", 
true)");
QP.FormFieldJavaScriptAction(fIndex, "F", "AFNumber_Format(2, 0, 0, 0, \"\\u0024\", 
true)";

© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum