This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/android/forms/javascript-validation.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. PDF form validation using JavaScript on Android

Nutrient supports a subset of JavaScript attached to documents, annotations, and forms. For supported features and limitations, refer to the PDF JavaScript support guide.

Nutrient supports most form validation scripts, but its JavaScript engine doesn’t cover the entire PDF specification.

Supported formatting API

Nutrient supports the following functions for form formatting and validation. Refer to Adobe’s documentation for function details.

Number formatting

Use these functions to format and parse numbers:

  • AFNumber_Format, AFNumber_Keystroke, AFMakeNumber, AFExtractNums

Percent formatting

Use these functions to format percentages:

  • AFPercent_Format, AFPercent_Keystroke

Date formatting

Use these functions to format and parse dates and times:

  • AFDate_Format, AFDate_FormatEx, AFDate_Keystroke, AFDate_KeystrokeEx, AFParseDateEx, AFTime_Format, AFTime_FormatEx, AFTime_Keystroke, AFTime_KeystrokeEx

Special formatting

Nutrient supports these special formatting functions:

  • AFSpecial_Format, AFSpecial_Keystroke, AFSpecial_KeystrokeEx, AFMergeChange

Simple formatting

Nutrient supports these calculation functions:

  • AFSimple, AFSimple_Calculate

Range validation

Use this function to validate a range:

  • AFRange_Validate