6 Replies Latest reply on Oct 11, 2011 5:59 AM by ghouser

    Field value from form in subject line?

    ghouser Level 1

      I'm using a submit by email button on my form and was wondering if it is possible to pull the value of a filled in field on the form into the subject line of the email that is generated?  The button is using the standard "mailto" followed by a "subject=".  I would like to have the subject of the email read something like: "New request - (account number or name from form here)".

       

      Thanks.

        • 1. Re: Field value from form in subject line?
          Steve L Walker Level 5

          You can use a button (control type 'regular'), add a click event handler and mimic the email submit button. In this example I included a form field called 'acctNumber' and inserted the rawValue into the sublect.

           

          // form1.page1.subform1.mySubmitBtn::click - (JavaScript, client)

           

          event.target.submitForm({cURL:"mailto:jblack@localhost?subject="+acctNumber.rawValue+"&bod y=Friendly Reminder",cSubmitAs:"PDF",cCharset:"utf-8"});

           

          Steve

          • 2. Re: Field value from form in subject line?
            ghouser Level 1

            To be honest, I don't follow.  If I make the button a "regular" then it doesn't have the tab for putting in the email address like a mailto: button does.  The "submit" tab goes away.  And I couldn't find how to do a click event in the help files.  I was probably searching for the wrong wording.  Where would your three lines of code be placed?

             

            Btw, the form is a PDF that each of our sales person will have on the desktop of their laptops out in the field, so it will not reside on a server.  It seems I read something about this making a difference on what actions are available.

             

            The whole intent of the project is to have a form quickly available to our sales team which they simply fill in the details of what they need and it gets emailed as a PDF attachment to the appropriate buyer in our company. I would gladly share this form if you wish to see it.  By your standards it's probably a kindergarten effort, but I have to start somewhere. :-)

            • 3. Re: Field value from form in subject line?
              Steve L Walker Level 5

              Take a look at the attached. It contains the script previously referenced.

               

              Steve

              • 4. Re: Field value from form in subject line?
                ghouser Level 1

                I don't see any script and the button has no more tabs than I wrote before. Could this be a version difference? I'm using v8.05.2703. Your example was created in a newer version, so perhaps my older version won't let me see or do what you are offering.

                • 5. Re: Field value from form in subject line?
                  Steve L Walker Level 5

                  The script is on the button click event.

                   

                  // form1.page1.subform1.mySubmitBtn::click - (JavaScript, client)

                   

                  event.target.submitForm({cURL:"mailto:jblack@localhost?subject="+acctNumber.rawValue+"&bod y=Friendly Reminder",cSubmitAs:"PDF",cCharset:"utf-8"});

                   

                  If you are referring to the tabs on the object properties, they are configurable by right-clicking the dark grey space to the right of the last tab.

                  Untitled.png

                   

                  This functionality is not impacted by a newer version of Designer. This has been around since the first version of Designer and I doubt that it has changed.

                   

                  Steve

                  • 6. Re: Field value from form in subject line?
                    ghouser Level 1

                    I thought everything with a button was done on the tabs and hadn't discovered the scripting window. I have it turned on now and understand what you were saying. Goes to show you can still learn over 50.  :-)  However the script did produce a syntax error.

                     

                    syntax.jpg