Validating Fields while preventing an email to be sent until all required fields are c
Hi all-
I was hijacking someone else post and since I was probably being impolite, I thought I better move my post over to a new post. I do want to thank all of those who have helped me so far.
If anyone want to look at the original post, here it is: https://community.adobe.com/t5/acrobat/validating-fields-in-javascript-while-preventing-an-email-to-be-sent-until-all-required-fields-are/m-p/11443084?page=1#M277505
I am posting all Javascript in the PDF and I attach the pages of the PDF file to give you an idea of what I am trying to accomplish. I hope I have enough detail in here.
Script to apply "Today's Date". It works.
//<AcroForm> //<ACRO_source>Today's Date:Calculate</ACRO_source> //<ACRO_script> /*********** belongs to: AcroForm:Today's Date:Calculate ***********/ dateToday(); //</ACRO_script> //</AcroForm>
Button 2 script
//Validation of the fields;
var emptyFileds - new Array(); //array to hold imcomplete field names;
var oField; // variable to hold field object being tested;
var bProcess = true; // assume all fields completeed;
this.getField("Step 3 - Email will open click the Send email button.").display = display.hidden;
this.getField("Step 4 - Finish").display = display.hidden;
if (oField.valueAsString == oField.defaultValue) {
oField.strokeColor = color.red;
emptyFields.push(oField.name);
bProcess = false;
}
else { oField.strokeColor = color.transparent;
this.getField("Step 2 - Review your answers then click here to submit form").display = display.visible;
}Button 3 - No script, just a "Submit a form" and "Show/hide a field action"


Step 4 - No script - just a "Reset a form", Execute a menu item - View > Page Navigation > First Page", (2) "Show/Hide a field" actions.

I reset all fields

Then go to First Page of a 4 page PDF file
Now Hide Step 3 button

Hide Step 4 button.

End of processing.