Here's a sample of what I eventually came up with and it works.
 
var array1 = ['debt_tot_mthly_pmt','debt1_int_rate','debt2_int_rate','debt3_int_rate'];
var array2 = ['2','3','3','3']; // where the element is the number of decimal places inthe number format
for (i = 0; i < array1.length; i++){
  try{
    f = this.getField(array1[i]);
    if (f != null){
      f.setAction("Keystroke","AFNumber_Keystroke(" + array2[i] + ", 0, 0, 0, '', false);");
      f.setAction("Format","AFNumber_Format(" + array2[i] + ", 0, 0, 0, '', false);");
    }
  }catch(e){
    console.println(array1[i] + ' ' + e);
  }
}
Thanks for the help.
 
-Steve
 
----- Original Message -----
Sent: Monday, December 06, 2004 11:00 AM
Subject: RE: [iText-questions] How do you set the field format category?

That's done using JS functions that ship with Acrobat. Create your field in Acrobat with the format and copy the JS to iText.


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Cole
Sent: Monday, December 06, 2004 3:45 PM
To: [EMAIL PROTECTED]
Subject: [iText-questions] How do you set the field format category?

How do you apply a format category to a fillable PDF field? I know how to use iText get the field, set the field value, and add _javascript_ to do things like make the field read-only, apply character limits and setting actions to highlight fields, but I can't find any information about how to apply a format category using either iText or Acrobat _javascript_. To be honest, I can't even find references to it in the Acrobat _javascript_ reference. Anyone know how do this?
 
Thanks,
 
Steve
 

Reply via email to