• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Popup and required field

Community Beginner ,
Mar 23, 2021 Mar 23, 2021

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

TOPICS
Create PDFs , JavaScript , PDF forms

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 23, 2021 Mar 23, 2021

Remove the space between the back-slashes and the double-quotes (") characters.

Votes

Translate

Translate
Community Expert ,
Mar 23, 2021 Mar 23, 2021

Copy link to clipboard

Copied

What should trigger this pop-up to appear? You have to use an event, not a non-event...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 23, 2021 Mar 23, 2021

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 23, 2021 Mar 23, 2021

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 23, 2021 Mar 23, 2021

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 23, 2021 Mar 23, 2021

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 23, 2021 Mar 23, 2021

Copy link to clipboard

Copied

Sorry... it says:

SyntaxError: missing ) after argument list

2: to the line 3

screen.png

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 23, 2021 Mar 23, 2021

Copy link to clipboard

Copied

Remove the space between the back-slashes and the double-quotes (") characters.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 23, 2021 Mar 23, 2021

Copy link to clipboard

Copied

LATEST

Great! It works!

Many many thanks!

Ciao!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines