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

Required Fields

New Here ,
Nov 29, 2018 Nov 29, 2018

Error: At least one required field was empty. Please fill in the required fields (highlighted) before continuing

I have removed all of the required fields in my pdf but I am still getting this error. Is there a way to search for a required field that may be hidden?

TOPICS
PDF forms
4.8K
Translate
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
1 ACCEPTED SOLUTION
LEGEND ,
Dec 04, 2018 Dec 04, 2018

Execute the following code in the interactive JavaScript console (Ctrl+J):

for (var i = 0; i < numFields; i += 1) {

    var f = getField(getNthFieldName(i));

    if (f && f.type !== "button" && f.required && !f.valueAsString) {

        console.println("Name: " + f.name + "\tType: " + f.type + "\tPage: " + f.page);

    }

}

If it indicates a field with a page of -1, it's on a hidden template.

View solution in original post

Translate
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 ,
Dec 04, 2018 Dec 04, 2018

With Javascript you can check the property required of the fields.

Translate
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 ,
Dec 04, 2018 Dec 04, 2018

Execute the following code in the interactive JavaScript console (Ctrl+J):

for (var i = 0; i < numFields; i += 1) {

    var f = getField(getNthFieldName(i));

    if (f && f.type !== "button" && f.required && !f.valueAsString) {

        console.println("Name: " + f.name + "\tType: " + f.type + "\tPage: " + f.page);

    }

}

If it indicates a field with a page of -1, it's on a hidden template.

Translate
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 28, 2019 Mar 28, 2019

Good day

How do I add this script in the debugger ?

Thank you

J

Translate
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 28, 2019 Mar 28, 2019

Copy and paste.

Translate
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 28, 2019 Mar 28, 2019

I have tried to do this, however it does not allow me to type in the script area.

Translate
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 ,
Mar 28, 2019 Mar 28, 2019

Please show a screen shot of what you are trying. Please DO NOT EMAIL IT.

Translate
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 ,
May 13, 2019 May 13, 2019

This is the screen with the debugger. Where should I enter the script as it does not allow me to type anywhere.

Thank you

ADOBE 2019-05-13_13-14-40.gif

Translate
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 ,
May 13, 2019 May 13, 2019

What happens when you type in the field at the bottom?

Translate
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 ,
May 13, 2019 May 13, 2019

It does not allow me to type in any of the fields.

Translate
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 ,
May 13, 2019 May 13, 2019

Repair your Acrobat installation.

Translate
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 ,
May 13, 2019 May 13, 2019

Go to Edit - Preferences - JavaScript and tick "Enable interactive console".

Translate
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 ,
May 13, 2019 May 13, 2019

That worked. Thank you.

Translate
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 ,
May 13, 2019 May 13, 2019

I can now enter the script, however the result is "undefined" as per below.

Translate
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 ,
May 13, 2019 May 13, 2019

"undefined" just means the script completed executing. It seems that no fields were found that match the criteria you specified.

Translate
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 ,
May 13, 2019 May 13, 2019

My issue at the moment is as follows :

The form based on certain field values displays or hides other fields. I use the following to hide/un-hide and make fields mandatory.

//start of script

this.getField("PARTNER").required = (event.target.value!="Off");

this.getField("PARTNER").display = display.hidden;

If condition true

   this.getField("PARTNER").display = display.visible;

   this.getField("PARTNER").required = (event.target.value!="On");

When I submit the form, it gives the error of

Adobe.gif

I have manually gone through all the fields and un-selected "required" in the general tab, and this seems to work, however I need to ensure that based on key field values the information that is mandatory is filled before submitting.

Kindly advise.

Thank you

Translate
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 ,
May 13, 2019 May 13, 2019

The following is not Javascript:

If condition true

Translate
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 ,
May 13, 2019 May 13, 2019

Be sure to SELECT all of the script before you execute it, otherwise it only does the current single line. Weird editor.

Translate
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 ,
May 13, 2019 May 13, 2019

Thank you for the replies.

From my investigation, I need to know how can I switch fields mandatory or not based on other field selections.

Thank you

J

Translate
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 ,
May 13, 2019 May 13, 2019

Hi

The if condition is not the issue as it was a representation, however the actual code is :

//start of script

this.getField("PARTNER").required = (event.target.value!="Off");

this.getField("PARTNER").display = display.hidden;

if (event.value == "INDIRECT")

  {

   this.getField("PARTNER").display = display.visible;

   this.getField("PARTNER").required = (event.target.value!="On");

}

Translate
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 ,
May 13, 2019 May 13, 2019

Where does you use this script?

Translate
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 ,
May 13, 2019 May 13, 2019

In Calculate tab, Custom Calculation script.

Translate
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 ,
May 13, 2019 May 13, 2019

What values does you use in the field?

Translate
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 ,
May 13, 2019 May 13, 2019

I assume you mean the fields that I wish to hide/unhide. These are text fields and can also be a drop down.

Translate
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 ,
May 13, 2019 May 13, 2019
LATEST

I mean the field with the calculation script.

Translate
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