These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Check required fields + automated subject line in Adobe Acrobat forms

ksprecher
Registered: Oct 12 2009
Posts: 5

I created a form using Adobe Acrobat 9.0 Standard. On this form, I have a submit button that when clicked must do two main things: (1) Check if required fields are filled and prompt the user to fill in fields if needed; and (2) if all required fields are filled in, save the form as a full PDF attachment in an email with an automated subject line. I currently am successful at automating the email with subject line but am struggling with the required fields check.

My javascript runs when the button is pressed down. When the user currently presses this button, however, no action occurs. Any help is much appreciated! I am inexperienced with javascript.

var RequiredFields = new Array(19);
RequiredFields[0] = "Salesperson";
RequiredFields[1] = "Initiation Date";
RequiredFields[2] = "Project Type";
RequiredFields[3] = "Sponsoring Customer";
RequiredFields[4] = "Part Description";
RequiredFields[5] = "EAU";
RequiredFields[6] = "EAU Units";
RequiredFields[7] = "Fastener Inclusion";
RequiredFields[8] = "Quantities to Quote";
RequiredFields[9] = "Supplier Location (Domestic required?)";
RequiredFields[10] = "Sample Quantity Requested";
RequiredFields[11] = "Sample Quantity Requested - units";
RequiredFields[12] = "PPAP required (yes or no)";
RequiredFields[13] = "PPAP level required";
RequiredFields[14] = "Approval Instructions";
RequiredFields[15] = "Materials";
RequiredFields[16] = "Application Description";
RequiredFields[17] = "Surface Requirements";
RequiredFields[18] = "ID Requirements";
RequiredFields[19] = "Key Requirements";

var AlertMsg = new Array(19);
AlertMsg[0] = "Please indicate the Salesperson name (pg. 1).";
AlertMsg[1] = "Please enter the date (pg. 1).";
AlertMsg[2] = "Please indicate the project type (pg. 1).";
AlertMsg[3] = "Please specify the sponsoring customer (pg. 1).";
AlertMsg[4] = "Please enter the part description (pg. 1).";
AlertMsg[5] = "Please indicate the estimated annual usage (EAU) (pg. 1).";
AlertMsg[6] = "Please indicate the units for the EAU (pg. 1).";
AlertMsg[7] = "Please specify if the quote should include fasteners (pg. 1).";
AlertMsg[8] = "Please specify the quantities that our suppliers should quote (pg. 1).";
AlertMsg[9] = "Please specify if the supplier needs to be domestic (pg. 1).";
AlertMsg[10] = "Please specify the quantity of samples required for the customer (pg. 1).";
AlertMsg[11] = "Please specify the units for the requested samples (pg. 1).";
AlertMsg[12] = "Please specify if a PPAP is required (pg. 1).";
AlertMsg[13] = "Please specify the PPAP level required (pg. 1).";
AlertMsg[14] = "Please specify the instructions for approving parts (pg. 2).";
AlertMsg[15] = "Please specify the materials of this part (pg. 2).";
AlertMsg[16] = "Please describe the application of the part (pg. 2).";
AlertMsg[17] = "Please describe the surface requirements of the part (pg. 2).";
AlertMsg[18] = "Please describe the ID requirements (pg. 2).";
AlertMsg[19] = "Please indicate the key requirements for this part (pg. 2).";

var bSuccess=True
var emptyTest=/^\s*$/;
var fieldCount=RequiredFields.length
var fld=0;

for(var i=0;i

My Product Information:
Acrobat Standard 9.1.3, Windows
sharonv
Registered: Nov 30 2010
Posts: 1
I also need an answer to this, is anyone able to provide coding for this?

sharonv

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Your script is incomplete. The 'for(var i=0;i' is not a complete statement and it appears you are missing the block of code to be processed by the for loop.

Do you get any error messages in the JavaScript console?

George Kaiser