1 Reply Latest reply: Apr 20, 2012 3:57 AM by igor_hb RSS

    Send form like pdf

    igor_hb Community Member

      Hi,

       

      I have form and I need to send form in PDF format to specific mail ...

      in the start user must select check box :

           when user select 1 check box option subject mail is Name 1 + address2 ....

           when user select 2 check box option subject mail is Name 2 + address2....

       

      My problems (sorry I'm beginner), is button for send form in the PDF format ...

       

      I create one button for each subform like (click event) :

       

      --------------- subform1 -----------------

      var oDoc = event.target;

      oDoc.mailDoc(

      {

      bUI: true,

      cTo: "a@b.com",

        cSubject: form1.page1.subform1.Name1.rawValue + " " + form1.page1.subform1.address1.rawValue

      });

       

      ------------------ subform2 -----------

      var oDoc = event.target;

      oDoc.mailDoc(

      {

      bUI: true,

      cTo: "a@b.com",

        cSubject: form1.page1.subform2.Name2.rawValue + " " + form1.page1.subform2.address2.rawValue

      });

      -----------------------------------------------

      But that work only for option 1.

      When select on then check box option 2 and press button - don't work.

       

      Can i set one button for all form (and where put it) , where mail subject will be value from actual subform , and format form="pdf" ?

       

      Thanks ...

        • 1. Re: Send form like pdf
          igor_hb Community Member

          I have solution :

           

          in each subform create a Button (Object -> Field -> Control type -> Regular)  with click event :

           

          var vSubject;

          var vCC="";

          var vBody="";

          var vEmail="a@b.com";

           

          // Create subject from subform field :

          vSubject = first_name.rawValue + " " + last_name.rawValue + " - born : " + born_date.rawValue ;

           

          event.target.submitForm({cURL:"mailto: "+ vEmail +"?subject=" + vSubject +"&body=" + vBody + vCC,cSubmitAs:"PDF",cCharset:"utf-8"});