You could do something like this:

if (event.value > 3 && event.value < 10) {
    event.rc = false;
    app.alert({
        cMsg: "Please contact Larry at xxx to process your form.",
        cTitle: "My Window Title",
        nIcon: 0,
        nType: 1
    });
}

You can enter this validation script by editing the properties of a field. Go to "Validate Tab", click "Run custom validation script", then "Edit...". Type the code into the JavaScript Editor window, and then click "Ok" and "Close".


(source: skitch.com)

Answer from Kyle Ridolfo on Stack Overflow
🌐
TutorialsPoint
tutorialspoint.com › javascript › pdf › javascript_form_validations.pdf pdf
http://www.tutorialspoint.com/javascript/javascript_form_validations.htm
Now we will see how we can validate our entered form data before submitting it to the web server. The following example shows how to validate an entered email address. An email address must · contain at least a ‘@’ sign and a dot . . Also, the ‘@’ must not be the first character of the email · address, and the last dot must at least be one character after the ‘@’ sign. ... Try the following code for email validation.
🌐
DEV Community
dev.to › idrsolutions › how-pdf-forms-use-javascript-for-validation-de
How PDF forms use JavaScript for validation - DEV Community
1 month ago - They offer the ability to output ... the field has lost focus. For a validate scriptTest, the JavaScript must return a value that is true in order to pass validation....
🌐
IDRSolutions
blog.idrsolutions.com › home › how pdf forms use javascript for validation
How PDF forms use JavaScript for validation
October 24, 2025 - They offer the ability to output ... and when the field has lost focus. For a validate scriptTest, the JavaScript must return a value that is true in order to pass validation....
🌐
Nutrient
nutrient.io › web › forms › javascript validation
PDF form validations using JavaScript | Nutrient SDK
To disable it, set NutrientViewer.Options.PDF_JAVASCRIPT to false before loading Nutrient: ... Form field validation consists of ensuring that the value of a form field is always correct.
🌐
Acrobatusers
answers.acrobatusers.com › How-validate-pdf-form-fields-content-javascript-q285465.aspx
How to validate pdf form fields content using javascript? (PDF Forms)
October 26, 2009 - if(event.value != "") { var regx = /^[a-zA-Z\s]+$/; if (regx.test(event.value) == false) { app.alert("The entered value needs to be a valid letters"); event.rc = false; } } You can even use the RegExp to limit the keystroke entries and split the string for special formatting. By George Kaiser · Please specify a reason: Spam · Duplicate · Moderate Content · Other · Questions · Experts Within this topic · Installation & updates · Acrobat Reader · Create PDF ·
🌐
Pdfscripting
pdfscripting.com › home › form data validation
Form Data Validation | pdfscripting.com
Acrobat has a kind of built-in Form Level Validation. The PDF form fields have a required property. Any field that is marked with "required" must be filled in before Acrobat will allow the PDF to be submitted. On a failed submit, Acrobat will display a popup message and highlight all required fields, whether they are filled in or not. Unfortunately, Acrobat doesn't do any checking when the document is printed, saved, or emailed using JavaScript...
🌐
W3C
w3.org › WAI › WCAG21 › Techniques › pdf › PDF22
PDF22: Indicating when user input falls outside the required format or values in PDF forms | WAI | W3C
The objective of this technique is to notify the user when user input to a field that requires a specific, required format (e.g., date fields) is not submitted in that format. If the required format is not used, an alert dialog describes the nature of the error in text.
Find elsewhere
🌐
Scribd
scribd.com › document › 695615843 › JavaScript-Form-Validation
JavaScript Form Validation | PDF | Java Script | Computing
JavaScript can be used to validate form fields client-side before submission. Some examples of JavaScript form validation include: 1. Validating that a name field is not empty and a password field has a minimum length of 6 characters.
🌐
Adobe Acrobat
acrobatusers.com › forum › forms-acrobat › simple-javascript-validation-example-please
Simple javascript validation example please
October 26, 2009 - And here's the summary for those that need it in the future: To validate email in a pdf form input in Acrobat 9 Pro, you can do the following: - open the properties of the email field - click the validate tab - click "Run custom validation script" - click "Edit..."
🌐
Stack Overflow
stackoverflow.com › questions › 69092897 › javascript-for-pdf-form-validation
Javascript for PDF form validation - Stack Overflow
September 7, 2021 - You can see the required fields for validation in the link. drive.google.com/file/d/17cPvXrdp7dkMTVnlXlhd9yNk5jxFV1SM/… ... @SyedRM I added a working example, but you should not expect users on SO to write code for you. I see this is your first question, so a good starting point would be to read this: stackoverflow.com/help/how-to-ask ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... NetTrain: One or more inputs provided to port "Output" was invalid: input is not an integer between 1 and 2
🌐
PDF Share Forms
help.pdfshareforms.com › hc › en-us › articles › 219553948-Custom-Validate-JS-Scripts
Custom Validate JS Scripts – PDF Share Forms
November 14, 2017 - Validation runs when the associated field value changes. The purpose of field level validation is to verify that the input to a field is entered correctly.
🌐
Fsu
ww2.cs.fsu.edu › ~faizian › cgs3066 › resources › Lecture13-HTML Forms and Javascript Validation.pdf pdf
HTML Forms and Javascript Validation
Hi, As I mentioned in the class, our next class on Monday March 5th is canceled. See you on Wednesday. - Peyman · Hi, I have extended the deadline to submit the second assignment until March 21st. Happy Spring Break! - Peyman · Hi, The second exam will be on Wednesday March 28th. This exam will cover all topics related to javascript...
🌐
PrintFriendly
printfriendly.com › document › javascript-form-validation-made-easy-quick
JavaScript Form Validation Made Easy and Quick
This file provides a comprehensive JavaScript form validation script that allows users to easily validate input fields in web forms. It includes detailed instructions on downloading and utilizing the script effectively.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn_web_development › Extensions › Forms › Form_validation
Client-side form validation - Learn web development | MDN
December 5, 2025 - If you want to change the text of the native error messages, JavaScript is needed. In this section we will look at the different ways to do this. The Constraint Validation API consists of a set of methods and properties available on the following form element DOM interfaces:
🌐
Adobe
opensource.adobe.com › dc-acrobat-sdk-docs › library › jsdevguide › JS_Dev_AcrobatForms.html
Using JavaScript in Forms
In the above code, the event.rc is used to signal that the input is acceptable (true) or not acceptable (false). In this way, the input can be checked, validated, and formatted, or, at some stage, can be canceled by setting event.rc = false. Full documentation of the objects used in the above sample script can be found in the Acrobat JavaScript API Reference.
🌐
The Odin Project
theodinproject.com › lessons › node-path-javascript-form-validation-with-javascript
Form Validation with JavaScript | The Odin Project
The form doesn’t need to actually submit, but you should give an error message if the button is pushed with any active errors or unfilled required fields. For the sake of this lesson, make sure the <form> element has the novalidate attribute which will allow you to do all of your validation in your JavaScript files.
🌐
Medium
roshnnoronha.medium.com › validating-and-calculating-pdf-form-fields-using-javascript-3ca445f8b0b6
Validating and Calculating PDF Form Fields | by Roshn Noronha | Medium
February 16, 2024 - ... In the Validate tab there is also an option to Run custom validation script. Using this option, it is possible to perform more complex validation on the field using JavaScript.
🌐
W3Resource
w3resource.com › javascript › form › javascript-sample-registration-form-validation.php
JavaScript: A sample registration form validation - w3resource
August 19, 2022 - JavaScript: In this document we have discussed JavaScript Form Validation using a sample registration form.