Skip to main content
Participant
May 21, 2016
Question

How to force users to fillup text field, check box, dropdown option before saving

  • May 21, 2016
  • 1 reply
  • 799 views

I have a 2 pages pdf form which includes several required fields (text box, check box, dropdown optoin) and a save button.

I want the following actions to be happened before pressing "save as" button. (They can't save by pressing save button without doing the following actions)

1. Users must have to input data into the text field

2. Users have to select at least an option (if needed more than one) from the check box items

3. Users have to select an item from dropdown option from the list.

Thanks

This topic has been closed for replies.

1 reply

Inspiring
May 21, 2016

I would recommend against such an action since it could be so inconvenient for the user on a large form. You can add some indicator that required fields are not completed. in any number of ways like having a read only field displayed indicating the issue or have a layer with the warning visible. If you create the button for the "Save As" action you can prevent the saving but you cannot control the menu option 'Save' or 'Save as' nor can you control the tool bar buttons for save or save as.

The easiest way is to compare the "value" of the fields to the "defaultValue" of the field in some custom JavaScript code. The exact code would be dependent as to how you have set up the form and the field properties. Your form fields will need to have a default value that is not an acceptable "filled in" value. The "Required" property will only issue a warning when submitting the PDF to a URI address like a web page or a mailto action.

Cats_EyeAuthor
Participant
May 21, 2016

I tried to add something in the Save Button, so that they are forced to fill in those fields. Is it possible?

Inspiring
May 21, 2016

What button?

The button on the tool bar?

Just because you create a custom button that saves a PDF does not prevent users form using the Menue "File => Sava as.." or the Saver or Save AS ... button on the fool bar. To have something work with them you need to add custom JavaScript to the "Wiil Save" document action. If you create a custom button then you need to write custom JavaScript so all the code and the conditional statement is all within the scope of that block of code.