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

Required field alert upon submission

New Here ,
Sep 09, 2020 Sep 09, 2020

Copy link to clipboard

Copied

I have set several fields in my form to required. If the field is not completed upon submission the Adobe acrobat error message appears stating that at least one field is empty.

Is there a way to specify which fields are empty? Specify a list of empty fields the user needs to go back and complete? Instead of just a general statement.

If so how would I go about doing that? This is my 1st form I am completing.

TOPICS
PDF forms

Views

3.0K

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 Expert ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

Check the JS Console after clicking one of those check-boxes...

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 ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

Okay,

I've spent hours trying to figure out why the grant field will not validate. I looked at the JavaScript I'm not sure what I'm even looking for. I erased every reference in the JavaScript that referenced the grant field and not to work. Even when it was erased some of the commands still worked. Not sure why that happened. Any suggestions would be greatly appreciated. I am so close to getting this exactly how I need it.

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 Expert ,
Sep 11, 2020 Sep 11, 2020

Copy link to clipboard

Copied

This is the error message I'm getting:

 

TypeError: this.getField("grayimage") is null
16:Field:Mouse Up

 

It happens because there's no field with that name, and it causes the rest of the code to not work.

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
Participant ,
Sep 15, 2020 Sep 15, 2020

Copy link to clipboard

Copied

Hi,

I've used the code below which works fine, this was taken from the code discussion above, all works fine apart from the email doesn't show the subject line, any help appreciated.  Thanks Paul

 

// This is the form return e-mail. Its hardcoded // so that the form is always returned to the same address // Change address on your form var cToAddr = "Colette.Williams@sjp.co.uk"; var cCCAddr = "" // Set the subject and body text for the e-mail message var cSubLine = "St. James's Place PC Consultancy Request Form"; var cBody = ""; var emptyFields = []; for (var i=0; i<this.numFields; i++) { var f= this.getField(this.getNthFieldName(i)); if (f.type!="button" && f.required ) { if (f.defaultValue==f.valueAsString) emptyFields.push(f.name); } } if (emptyFields.length>0) { app.alert("Error! You must fill in the following fields:\n" + emptyFields.join("\n")); } else this.mailDoc({cTo: "Colette.Williams@sjp.co.uk"});

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 Expert ,
Sep 15, 2020 Sep 15, 2020

Copy link to clipboard

Copied

LATEST
@PerivanP

Your last comment does not appear in the forums due to a bug that prevents
more than 25 (sub-)replies under a single thread... Please post it as a new
reply.

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