Okay, don't ask me why, I just get totally dumbfounded by Java syntax and can't get past this.
I've found a great form validation script, which in a dummy form I've built, works great. I call the function on a "Validate" button and it works fine when a required field doesn't isn't filled in.
Here is the issue I'm having and just can't figure out. I want to add the function to my Email Form button and if there is missing information, it will stop the email script, run the validation script, good to go.
My email script is as follows:
{
//Send mail action
myDoc.mailDoc({
bUI: false,
cTo: address,
cSubject: subject,
cMsg: msgBody,
cSubmitAs: "PDF"
});
}
Thanks for anyone who can help with this, I have to take a Java class.
if (this.getField("FromAddress").value != '' && this.getField("ToAddress").value != '')
{
myDoc.mailDoc({
bUI: false,
cTo: "email [at] email [dot] com",
cSubject: "Subject",
cMsg: "Body of email",
cSubmitAs: "PDF"
});
}