Hi,
I included a Submit & an Email button in some of my forms. I've set them up as Regular buttons and coded them myself to do what I want eg:
if(xfa.host.messageBox("Please save this form before emailing or data will be lost","Save Form",1,1))
app.execMenuItem("SaveAs");
var sEmail = form1.Pg2.PtESF.Mgremail.rawValue;
var sSubject = ("Permit to Train Request by " + form1.Pg1.PtASF.FirstNameFld.rawValue + " " + form1.Pg1.PtASF.LastNameFld.rawValue);
var sBody = "Please approve the Permit to Train Request as attached.";
event.target.submitForm({cURL:"mailto: "+ sEmail +"?subject=" + sSubject +"&body=" + sBody,cSubmitAs:"PDF",cCharset:"utf-8"});
If I set them up as Submit buttons, they don't try to run the script more than once. I assumed this was because I had the code built in with the Submit option and it ran that as well as my own code.
So I changed the button to be a Regular button and then it worked perfectly - except for one thing.
It no longer validated the mandatory fields.
Can anyone tell me what's built into the Submit button (that I can't see), that I need to reproduce in my script for my regular button?
Thanks,
Peta