4 Replies Latest reply on Mar 19, 2010 3:19 AM by LFlorent

    Send mail button

    LFlorent

      I would have a question. I’m trying to setup a special PDF document that would allow the user to enter the required data and then just press a button and all the data entered into the PDF would be arranged in a correct format and sent to my email.

       

      What I should add to the “SEND” button to make this happen?

       

      I would like that when I press “SEND” I get the following:

                      -a new massage window in my preferred Email client should open

                      -the mail should be set to my email address

                      -the mail should have a specific subject field that would also include the name that was entered in the first name field (e.g.  if the name entered in the first name field is John then the Subject should “New user John”)

                      -the data entered should be in plain text format and also not all the fields should be in the text itself

       

      Should I look at JavaScript or should I use something else?

       

      Thanks in advance!

        • 1. Re: Send mail button
          LFlorent Level 1

          Ok I found the solution.

           

          The incomplete Send button code atm looks like this:

           

           

           

          var ime = this.getField("naziv");

          var ulica = this.getField("ulica");

          var postnast = this.getField("postnast");

          var posta = this.getField("posta");

           

          var formresults = ime.value + ", " + ulica.value + ", " + postnast.value + " " + posta.value ;

           

          app.mailMsg(false, "mymailaddress", "", "", "Prijava " + ime.value, formresults);

           

           

           

           

          As you can see this will take the form data and throw it in one row. The data will be seperated by a comma. Is there a way I could put in a command to throw the next data in a new line. I already tried to change the formresults string and add a "\n" character but acrobat wont let me close the edt window -> guess there is some other command that I am missing.

           

          Can anybody help?

          • 2. Re: Send mail button
            try67 MVP & Adobe Community Professional

            Where did you place it? Post the code that's causing the error.

            • 3. Re: Send mail button
              LFlorent Level 1

              Code atm:

               

              var formresults = ime.value + ", " + ulica.value  ;

               

              Produces the output:

               

              ime.value, ulica.value

               

               

               

              My goal is:

               

              ime.value

              ulica.value

               

               

               

              I tried to insert the "\n" command in there like this:

               

              var formresults = ime.value + \n + ulica.value ;

               

              I even tried:

               

              var formresults = ime.value \n ulica.value ;

               

              None of them got accepted and acrobat doesnt let me close the script editing window.

              • 4. Re: Send mail button
                LFlorent Level 1

                Ok now I found the solution. I just had to enter '\n' and it worked