So here's my script. It's added to a submit button as an action that I've created and set to save as first before this script executes.
var cToAddr = "IPG-VORD [at] imagepac [dot] com";
var cSubLine = "New Order: " +
this.getField("Customer Name").value +
" - " +
this.getField("Box ID").value;
var cBody = "Please Process order. \n" +
"\n" +
"CUSTOMER NAME: " +
this.getField("Customer Name").value + "\n" +
"BOX ID: " +
this.getField("Box ID").value
this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});
Everything works perfect! EXCEPT, I would like to validate the "Customer Name" & Box ID" fields before the save as command commences.
I'm not using a script for "Save As" but using the Execute a Menu Item.
Basically here's the order of what should happen.
1. Hit the SUBMIT BUTTON.
2. If the "Customer Name" & Box ID" are filled in, Save as then execute the above
script.
3. If not, then a pop up box saying the fields should be filled in prior to
submitting form.
NOTE: What the above script does is show a return address and the attached PDF
form with a subject line based on the "Customer Name" & "Box ID" Field as
well as the body of the email.
Any help would be appreciated.
CLIFF
You could also set up a dummy button at the same location as the real submit button so that when it is clicked it will display the error message. The dummy button would get hidden when the two fields have values. If you do this, you would simply hide the real submit button when the dummy should be shown, and vice versa.