This content has been marked as final. Show 8 replies
No you can not.
What properties would you like to change? If you provide a bit more context, we may be able to suggest an approach.
Thanks for the answers. I have simple adobe form with text fields in it on Properties -> Format, I want to change format category to Number and on Properties -> Validate, I want to change Field value is in range.
// Format script for
// number, two decimal places
AFNumber_Format(2, 0, 0, 0, "", false);
// Keystroke script
// two decimal places
AFNumber_Keystroke(2, 0, 0, 0, " ", false);
And for a Range validation script:
// Validation script
// In this example, 42 is the minimum
// and 999 is the maximum
AFRange_Validate(true, 42, true, 999);
So the code that sets these field actions might look like:
var f = getField("your_text_field");
f.setAction("Format", "AFNumber_Format\(2, 0, 0, 0, \"\", false\);");
f.setAction("Keystroke", "AFNumber_Keystroke\(2, 0, 0, 0, \"\", false\);");
f.setAction("Validate", "AFRange_Validate\(true, 42, true, 999\);");
You'll have to study these various built-in functions to see how they behave, but this should get you started.
Thanks for the answer everything works fine. Can you tell me where I can read more about :
and other properties like this, I don't find anything in JS API Reference.
AFRange_Validate (Ctrl + Enter)
See, http://www.planetpdf.com/forumarchive/125041.asp, for more information about the AFNumber_Format() function. There was a small amount of documentation about these Acrobat builtin form functions in the version 5 JS Reference.
AFRange_Validate(bGreaterThan, nGreaterThan, bLessThan, nLessThan)
bGreaterThan - logical value to indicate the use of the greater than comparison
nGreaterThan - numeric value to be used in the greater than comparison
bLessThan - logical value to indicate the use of the less than comparison
nLessThan - numeric value to be used in the less than comparison
Thanks for the answers you really help me a lot. I'll see what google can tell me about this secret functions.