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

Required Ffelds not working with custom submit

New Here ,
Jan 20, 2021 Jan 20, 2021

Copy link to clipboard

Copied

Hello,

 

I am using the below Java (altered with my field names and e-mail address) from this page: https://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address/

 

// This is the form return email. It's hardcoded
// so that the form is always returned to the same address.
// Change address on your form to match the code below
var cToAddr = "formsAdmin@BigCorp.com"

// First, get the client CC email address
var cCCAddr = this.getField("ClientEmail").value;

// Now get the beneficiary email only if it is filled out
var cBenAddr = this.getField("BennyEmail").value;
if(cBenAddr != "")
cCCAddr += ";" + cBenAddr;

// Set the subject and body text for the email message
var cSubLine = "Form X-1 returned from " + this.getField("ClientFirstName").value + " " + this.getField("ClientLastName").value;
var cBody = "Thank you for submitting your form.\n" + "Save the filled form attachment for your own records" // Send the entire PDF as a file attachment on an email this.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr, cSubject: cSubLine, cMsg: cBody});

 

Prior to me adding this code the standard submit button would not submit throwing up an error about required fields not completed.  With the new button the form submits even with nothing filled in.  What code can I use and where would I put (if I need to put something on each required field) it so that the above button will not submit if required fields are not completed?

TOPICS
Create PDFs , JavaScript , PDF forms

Views

179

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 ,
Jan 20, 2021 Jan 20, 2021

Copy link to clipboard

Copied

LATEST

Info: Acrobat uses Javascript, not Java.

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