10 Replies Latest reply on Feb 23, 2016 9:01 AM by Rob Hecker2

    How to Send Page Data Along with Fillable Form?

    sneedbreedley Level 1

      How can I automatically include the page title or any text from my webpage when my client hits the Submit button on a fillable form?

        • 1. Re: How to Send Page Data Along with Fillable Form?
          Level 4

          This may seem obvious, but if you want to receive data from a form then put it in the form. A hidden form field with page title and text from your webpage will send you that data upon form submission.

           

          best,

          Shocker

          1 person found this helpful
          • 2. Re: How to Send Page Data Along with Fillable Form?
            Jon Fritz II Adobe Community Professional & MVP

            The only way to do it these days would be to attach a form to email script to your page.

             

            There are tons of them online, but your first stop should be with your hosting company. Most offer a script as part of your hosting package in a language your server already supports. They typically come with some fairly simple instructions (most copy/past style stuff) on how to add them to your page.

             

            If your hosting package doesn't come with access to a script, do a search for "--your supported server language-- form to email script" and you'll find hundreds of them available.

            • 3. Re: How to Send Page Data Along with Fillable Form?
              sneedbreedley Level 1

              So the answer is a hidden form field. From your suggestion, I was able to find the solution online.

               

              <input type="hidden" name="Year & Model" value="1966 Corvette">

              • 4. Re: How to Send Page Data Along with Fillable Form?
                Rob Hecker2 Adobe Community Professional & MVP

                Year & Model is a  bad variable name.

                 

                year_model or yearAndModel would be better

                • 5. Re: How to Send Page Data Along with Fillable Form?
                  Level 4

                  sneedbreedley wrote:

                   

                  So the answer is a hidden form field. From your suggestion, I was able to find the solution online.

                   

                  <input type="hidden" name="Year & Model" value="1966 Corvette">

                  Well.. there's other (more dynamic) ways to do it. You could pull the page data from a database and send the data from the server as a POST request. It's better than using hidden form fields, which a client can see (and manipulate) in the source code. That requires a little more advanced coding method though and you might not be ready to be overwhelmed with other techniques if what you have is working for you so far. As you're learning right now it's a cumbersome process to manage 40+ pages. It's much easier to build and maintain one dynamic page than it is to maintain 40+ semi-static pages that are peppered with server side includes.

                   

                  best,

                  Shocker

                  • 6. Re: How to Send Page Data Along with Fillable Form?
                    sneedbreedley Level 1

                    I noticed you included caps, was that intentional?

                    Also, I am using caps and spaces and it's all working well. What issues may I encounter?

                    • 7. Re: How to Send Page Data Along with Fillable Form?
                      Level 4

                      sneedbreedley wrote:

                       

                      I noticed you included caps, was that intentional?

                      Also, I am using caps and spaces and it's all working well. What issues may I encounter?

                      Look up camel case for more info about including caps. Just because using spaces in form name and id attributes is working well for you doesn't mean it will work well for everyone else. Not all browsers are created equally. Issues could range from formatting to inability to send data. To reduce possibility of undesired encounters with your users it's best practice to use all lowercase with underscores or camel case.

                       

                      best,

                      Shocker

                      • 8. Re: How to Send Page Data Along with Fillable Form?
                        sneedbreedley Level 1

                        To which fields does that apply?

                         

                        <input type="checkbox" name="option04" value="419 Auxiliary Hardtop (In addition to folding top)" id="option1_5">

                                    419 Auxiliary Hardtop (In addition to folding top)</label>

                         

                        <label for="Dealer Town">Dealer Town</label>

                                <input name="Dealer Town" type="text" id="Dealer Town" size="30">

                        • 9. Re: How to Send Page Data Along with Fillable Form?
                          Level 4

                          Shocker wrote:

                          Just because using spaces in form name and id attributes is working well for you doesn't mean it will work well for everyone else.

                          <input name="Dealer Town" type="text" id="Dealer Town" size="30">

                           

                          <input name="dealer_town" type="text" id="dealer_town" size="30">

                           

                          This was also discussed in this thread on post #17 a few days ago when I said this:

                          The only cause I can speculate is because you're using spaces and undesired characters like apostrophes in your form id and name attributes. Trying using only losercase letters and an underscore if you want to use multiple words as a value. So for example instead of name="Dealer's Name" use name="dealers_name"

                           

                          best,

                          Shocker

                          • 10. Re: How to Send Page Data Along with Fillable Form?
                            Rob Hecker2 Adobe Community Professional & MVP

                            Sneedbreedly,  what Shocker and I are pointing out is

                             

                            just because it works doesn't mean it ain't broken

                             

                            Also don't start variable names with numbers and avoid using mySQL reserved words.

                             

                            https://dev.mysql.com/doc/refman/5.5/en/keywords.html

                            http://php.net/manual/en/reserved.keywords.php

                             

                            For instance, in the future you may want to move your data to a database. What if you used "block" to hold data about the engine blocks? This would not work because block is a reserved word.

                             

                            I had a form where the user entered numbers. All worked fine for months until someone entered a negative number. Therefore. . .

                            just because it works doesn't mean it ain't broken