Copy link to clipboard
Copied
Hello everybody,
I am creating a form with a text field named as "MOTIVATION". I want a warning to appear if the number of characters (including letters, numbers and spaces) is less than 1000 characters when pressing save or close buttons. The warning will be like;
THE NUMBER OF CHARACTERS IS LESS THAN 1000.
DO YOU WANT TO CONTINUE?
YES / NO
Any help will be appreciated.
Regards
Vahap
You can't stop a PDF from being saved or closed. Maybe you should popup a warning when the user finishes typing in the field. Use a validation script for this.
Or you could have a big red text field displayed at the top or bottom of the form that doesn't go away until the field is filled correctly.
In any case, this code will display an alert for a field that has less than 1000 characters
if(this.getField("Text1").valueAsString.length < 1000)
app.alert("Less than 1000 characters");
Yo
...Copy link to clipboard
Copied
You can't stop a PDF from being saved or closed. Maybe you should popup a warning when the user finishes typing in the field. Use a validation script for this.
Or you could have a big red text field displayed at the top or bottom of the form that doesn't go away until the field is filled correctly.
In any case, this code will display an alert for a field that has less than 1000 characters
if(this.getField("Text1").valueAsString.length < 1000)
app.alert("Less than 1000 characters");
You can find out more about alert box scripts here:
https://acrobatusers.com/tutorials/popup_windows_part1/
Copy link to clipboard
Copied
Hi Thom,
thanks a lot for your help.
Regards
Vahap