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

How to enforce required fields when the form is completed by clicking the signature

New Here ,
Jan 08, 2018 Jan 08, 2018

Copy link to clipboard

Copied

How do I enforce my required fields when the form is completed?

Is there a way to have an alert pop up when there are required fields are blank when I click on the signature box, letting the user know what boxes still need to be completed before you can finalize the form by signing it.

Acrobat DC

TOPICS
PDF forms

Views

24.3K

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

LEGEND , Aug 18, 2018 Aug 18, 2018

The "Required" field property is used to validate PDF forms submitted to a web page with scripting to process the form data, so it has no connection with the signature field unless you create that connection.

I would set the signature field to read only and hidden. I would create a button that runs a custom JavaScript to loop through all the fields on the form and test the value of the fields that have the "required" property set to true and track the fields whose value is equal to the default v

...

Votes

Translate

Translate
Community Expert ,
Jan 08, 2018 Jan 08, 2018

Copy link to clipboard

Copied

You can validate the required fields, but you can't prevent the user from signing the form, unless you hide the signature field and then use a script (triggered from a button, for example) to only show it if all the required fields are filled-in.

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
LEGEND ,
Jan 08, 2018 Jan 08, 2018

Copy link to clipboard

Copied

You can make the signature field read only and have a button next to it that runs a script to check that the required fields have been completed and if they are completed the signature field becomes unlocked.

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 ,
Aug 18, 2018 Aug 18, 2018

Copy link to clipboard

Copied

Hi,

Could you help show what code to use to enable this?

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
LEGEND ,
Aug 18, 2018 Aug 18, 2018

Copy link to clipboard

Copied

The "Required" field property is used to validate PDF forms submitted to a web page with scripting to process the form data, so it has no connection with the signature field unless you create that connection.

I would set the signature field to read only and hidden. I would create a button that runs a custom JavaScript to loop through all the fields on the form and test the value of the fields that have the "required" property set to true and track the fields whose value is equal to the default value of the field. If there any fields found where this condition is true then the form is not ready for signature. If none are found then unprotect the signature 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 ,
Aug 18, 2018 Aug 18, 2018

Copy link to clipboard

Copied

thanks a lot!  I'll try your suggestion.

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
New Here ,
Jul 19, 2022 Jul 19, 2022

Copy link to clipboard

Copied

I'm working on a form that has the same requirements. I need to restrict the digital signature unless all required fields (dates, radio buttons, and conditional text boxes [if "yes" is selected in radio buttons, the text field is required]). I'm being asked to create a popup alert if required fields are not filled in when the user tries to sign. Would you possibly have an example of how to do this? Thank you in advance!

 

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
New Here ,
May 02, 2023 May 02, 2023

Copy link to clipboard

Copied

Were you able to figure this out? Did anyone come up with example code? Thanks in advance!!

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 ,
Nov 03, 2020 Nov 03, 2020

Copy link to clipboard

Copied

Is there a tutorial how to make that? What button? And what would be the script. 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
New Here ,
Mar 08, 2021 Mar 08, 2021

Copy link to clipboard

Copied

I'm wondering this as well - can anyone provide a bit more instruction here? @gkaiseril ?

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
New Here ,
Jul 15, 2023 Jul 15, 2023

Copy link to clipboard

Copied

LATEST

I have tried this so many ways but when the fields aree completed on page1 the Siginiture on page2 does not unhide

Do you or anyone have some script itried

this.getField("Signature2").Readonly = !validateRequiredFields(this);
 
function validateRequiredFields(doc) {
var emptyFields = [];
for (var i=0; i<doc.numFields; i++) {
var f = doc.getField(doc.getNthFieldName(i));
if (f!=null && f.type!="button" && f.required && f.valueAsString==f.defaultValue) {
emptyFields.push(f.name);
}
}
 
if (emptyFields.length>0) {
app.alert("You must fill in the following fields:\n" + emptyFields.join("\n"));
return false;
}
return true;
}

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