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
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

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

Gotterkraft
Level 1
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
PulkitJain
Correct answer by
Employee
Employee

@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
PulkitJain
Correct answer by
Employee
Employee

@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