Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

How can I prevent saving a form if there are required items empty?

Avatar

Level 1

I have a form which has both text fields and drop downs that are required to fill out.  The problem is people can still save the document even though the required items are left blank.  How can I prevent someone from saving the form and not leave any of those requirements blank?

 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@Gotterkraft 

Ideally, when you set the form objects as Required i.e "Type: User entered required" in a PDF Form then ideally, the user won't be able to submit the form without filling the required fields.

In your case, if this is a requirement then you can put your validation code[0] on preSave event to warn the user that the form is not complete. Please be informed that this may just notify them if there are any missing fields, not stop them from saving.

Just another tip, all required fields are marked as <validate nullTest="error"/> in the XML source.

 

[0]- 

Page1.execValidate();

 

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

@Gotterkraft 

Ideally, when you set the form objects as Required i.e "Type: User entered required" in a PDF Form then ideally, the user won't be able to submit the form without filling the required fields.

In your case, if this is a requirement then you can put your validation code[0] on preSave event to warn the user that the form is not complete. Please be informed that this may just notify them if there are any missing fields, not stop them from saving.

Just another tip, all required fields are marked as <validate nullTest="error"/> in the XML source.

 

[0]- 

Page1.execValidate();

 

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now