Skip navigation
el cheque
Currently Being Moderated

Change formatting of multiple form fields

Jul 30, 2012 12:30 PM

I can't seem to figure out how to change the formatting of multiple fields. When multiple fields are selected, the formatting option is absent in the "Field Properties" dialog box.

 
Replies
  • George Johnson
    11,673 posts
    Aug 11, 2002
    Currently Being Moderated
    Jul 30, 2012 12:53 PM   in reply to el cheque

    That's intentional. An alternative is to use a script that uses the field.setAction method: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_A croJS.88.750.html

     

    If using one of the built-in formatting options, you have to figure out what the corresponding script is for the format and keystroke events. What do you want to set the formatting to?

     
    |
    Mark as:
  • George Johnson
    11,673 posts
    Aug 11, 2002
    Currently Being Moderated
    Jul 30, 2012 1:10 PM   in reply to el cheque

    With that few I would just do it manually. But if you think you might want to do this type of thing a lot and the field names involved would allow you to do it in a loop, the script would look something like:

     

    // Set formatting of fields to Number, no decimals

    for (var i = 1; i < 51; i += 1) {

        var f = getField("Text" + i);

        f.setAction({cTrigger: "Format", cScript: "AFNumber_Format(0, 0, 0, 0, \"\", false)");

        f.setAction({cTrigger: "Keystroke", cScript: "AFNumber_Keystroke(0, 0, 0, 0, \"\", false)");

    }

     

     

    This will change the format for fields named "Text1" - "Text50". You can run it from the interactive JavaScript console or a temporary button.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 30, 2012 1:22 PM   in reply to el cheque

    I've developed a script that allows you to apply the same formatting setting to multiple fields in a matter of seconds. Selecting the fields is quick and easy, and doesn't require any scripting knowledge.

     

    If anyone's interested, they can contact me privately.

     
    |
    Mark as:
  • George Johnson
    11,673 posts
    Aug 11, 2002
    Currently Being Moderated
    Jul 30, 2012 1:32 PM   in reply to el cheque

    You could change the script slightly and specify the field names in an array, and loop through the array. This is what I would do in your situation, assuming that it's the same fields in each of the 29 forms.

     

    Regarding why it behaves this way, I seem to recall someone from Adobe saying it would be too complicated for it to behave differently.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points