Form Field Formatting

When creating or editing a form field, it is possible to define formatting rules which are enforced through JavaScript. Field Formatting allows you to define how the values or text within a field will be displayed. For Example: Making currency always show 2 decimal places or a date that shows a 2 digit month, day, and year.

Note: Formatting options are only available for text boxes and combo boxes.

 

Setting Custom Field Formatting

  1. Access the field properties by right clicking (Mac: Ctrl + Click) on the field and choose Properties in the mouse menu or click on the edit button on the Mini Toolbar.
  2. Click on the Format Tab
  3. Set the options below to be applied to the selected field

Field Formatting Options

None - Default value, sets no formatting rules and any text can be entered into the field

Number - Sets the field to only accept numbers based on the settings selected

    • Decimal Places: number of decimal places to use
    • Separator Style: separators to use for thousands and decimal places
    • Currency Symbol: currency symbol to be used
    • Symbol Placement: the location of the currency symbol
    • Negative Number Style: the style of the text when the value is a negative number
      • Use red text: turns the negative number red
      • Use parenthesis: puts the negative number inside parenthesis

Percentage - Sets the field to display a percentage based on the settings selected

    • Decimal Places: number of decimal places to use
    • Separator Style: separators to use for thousands and decimal places

Date/Time - Sets the field to only accept date, time, or date-time values based on the settings selected.

    • Options List: Select any of the predefined date/time formats that come with Xodo PDF Studio
    • Custom: Create your own custom date/time format using the below date/time codes
      • yyyy = four-digit year     
      • yy = two-digit year
      • mm   = two-digit month (01=January, etc.)     
      • mmm = three letter month abbreviation (Jan=January, etc.)
      • mmmm = full month name
      • dd   = two-digit day of month (01 through 31)     
      • HH   = two digits of hour (00 through 23) (AM/PM NOT allowed)     
      • MM   = two digits of minute (00 through 59)     
      • ss   = two digits of second (00 through 59)
      • h = two digit hour using 12-hour AM/PM format 
      • tt = displays AM/PM based on the time

Note: When a date or date-time setting is selected when viewing the document Xodo PDF Studio will display a calendar button on the field. This button will allow users to select a date using a calendar picker instead of typing in the field if they wish.

Other - Allows you to select from a list of common predefined field formatting rules

    • US Zip Code: standard 5 digit US zip code
    • US Zip Code + 4: standard 5 digit US zip code plus the additional 4 digit geographic segment
    • US Phone Number: US phone number format (XXX) XXX-XXXX
    • US Social Security Number: US social security number format XXX-XX-XXXX
    • Custom: set a custom format using the below letter codes
      • 9 to allow numbers
      • A to allow letters
      • O (the letter) to allow numbers and letters
      • X to allow printable characters

Custom - Allows you to create your own custom formatting rules using the supported PDF Form JavaScript

Sample Format Examples

Date/Time

  • Year: yyyy (eg 1997)   
  • Year and month: yyyy-mm (eg 1997-07)  
  • Complete date: yyyy-mm-dd (eg 1997-07-16)   
  • Complete date plus hours and minutes: yyyy-mm-dd HH:MM (eg 1997-07-16 19:20)

Other / Custom

  • A phone number in France such as "05 44 06 72 25" would be represented by the following custom format: "99 99 99 99 99"
  • A phone number in Sweden such as "46 71 123 456" would be represented by the following custom format: "99 99 999 999"
  • A seat on a flight such as "99C" would be represented by the following custom format: "99A"