2 Replies Latest reply on Jul 18, 2011 8:47 AM by George_Johnson

    Prefilling text boxes

    Vicky3111988

      Hi Guys & Girls

       

      I have created a triplicate form for some of our clients to use to fill in our sales forms, is there a way to prefill a text box with what is being written on the first page (so that it appears in the same box on the second and third page?

       

      Any help on the matter would be great

        • 1. Re: Prefilling text boxes
          ~graffiti Adobe Community Professional & MVP

          There is IF you have Acrobat (you didn't mention what you used to create the form.)

           

          All you need to do is give the form fields identical names (they need to be in the same PDF of course). When one is filled out, there others are as well.

          • 2. Re: Prefilling text boxes
            George_Johnson MVP & Adobe Community Professional

            If you want to allow the user to change the value on the second page after it gets auto-filled with the value from the first page, you can use the following custom Validate script for the field on the first page:

             

            // Custom Validate script for text field
            (function () {
            
                if (event.value) {
            
                    var f = getField("text2");
            
                    if (!f.valueAsString) f.value = event.value;
                }
            
            })();
            

             

            Where "text2" is the name of the corresponding field on the second page. Its value will get auto-filled when the first field is committed, but only if it is blank. You could change this so that any existing entries are overwritten.

            1 person found this helpful