Skip navigation
Currently Being Moderated

Customizing the "Email Submit Button"

Aug 26, 2009 10:02 AM

I'm trying to customize the "email submit button" of a form so that whenever the user of the form clicks on the button it will save a copy of the form into a specific folder with the file name of the copy linked to one of the fields in the form. Then attach the copy of the form into an email with the subject linked to a separate field from the form. Finally have the orginal form closed. The part I don't have working is the save as file name, subject, attaching the copied PDF, and closing the orginal form. Any ideas? I'm using Designer 7.0

 
Replies
  • Currently Being Moderated
    Sep 29, 2009 9:48 AM   in reply to yenoomlekim

    I have never tried to save a form with a preset file name but following code may help you overcome some of the issues you have...I never tried to close a form with script either.

    I would use regular button instead of email button and use the following code in "click" event which will compose the email and attach the form in PDF format with the same name as it opens. Hope you can compromise on name of the attached document.

     

    try {
    var subj = "email subject here";
    var ebody = "email body text here"

    var mailTo = person@domain.com
    //xfa.host.messageBox("In a moment new email gets composed attaching copy of your request. Please complete the process by sending the email.")
    event.target.submitForm({cURL:"mailto:"+mailTo+"?subject="+subj+"&body="+ebody,cSubmitAs:"PDF",cChars et:"utf-8"});
    }catch (e) {
    //xfa.host.messageBox(""+e);
    xfa.host.messageBox("There was an error submitting this form as email.\nPlease email your concerns about this form to youremail@domain.com.\nPlease include the error description in the email.");
      exit;
    }

     

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points