Copy link to clipboard
Copied
Hi. I need to insert a popup message when a user not to fill out a required text field.
I don't know javascript...
Someone can help me?
Thank you
Remove the space between the back-slashes and the double-quotes (") characters.
Copy link to clipboard
Copied
What should trigger this pop-up to appear? You have to use an event, not a non-event...
Copy link to clipboard
Copied
My pdf has a lot of fields, but only one must be mandatory.
If the user does not fill in this field, when saving the file, the popup must show: required field.
Thanks
Copy link to clipboard
Copied
OK, but be aware that won't prevent the user from saving the file.
What's the name of that field?
Copy link to clipboard
Copied
Ok, i doesn't matter if you can save anyway. The important thing is that you see the alert.
The field is called: Data di trasferimento
Thanks again!
Copy link to clipboard
Copied
OK, go to Tools - JavaScript - Set Document Actions and under the Document Will Save event add the following code:
var f = this.getField("Data di trasferimento");
if (f.valueAsString==f.defaultValue) app.alert("You need to fill in \"Data di trasferimento\"!",1);
(You can adjust the text of the message to whatever you want it to be, of course)
Copy link to clipboard
Copied
Sorry... it says:
SyntaxError: missing ) after argument list
2: to the line 3
 
Copy link to clipboard
Copied
Remove the space between the back-slashes and the double-quotes (") characters.
Copy link to clipboard
Copied
Great! It works!
Many many thanks!
Ciao!