7 Replies Latest reply on Sep 28, 2011 4:00 AM by try67

    Auto-fill Address Details

    ajmayjnr

      Hi All,

       

      I am searching for a script that allows me to have the Name, Address etc details auto-fill from a previousy entered section of the form if "As above" is selected.... I have found some examples but unfortunately they aren't clear.  If anyone has come across or done something similar I would really appreciate the guidance.

       

      Thanks!

       

      Ant

        • 2. Re: Auto-fill Address Details
          ajmayjnr Level 1

          try67, I appreciate your help yet again.  Trying now.

          • 3. Re: Auto-fill Address Details
            ajmayjnr Level 1

            If there are multiple fields, what would the best result be?  This doesn't work:

             

            if (getField("PayerMember").value=="Yes")

            getField("paymentdetTitle").value = getField("Title").value

            else getField("paymentdetTitle").value = "";

            getField("paymentdetName").value = getField("PersonalName").value

            else getField("paymentdetName").value = "";

            getField("paymentdetSurname").value = getField("PersonalSurname").value

            else getField("paymentdetSurname").value = "";

            getField("paymentdetAddress").value = getField("PersonalAddress").value

            else getField("paymentdetAddress").value = "";

            getField("paymentdetSuburb").value = getField("PersonalSuburb").value

            else getField("paymentdetSuburb").value = "";

            getField("paymentdetState").value = getField("PersonalState").value

            else getField("paymentdetState").value = "";

            getField("paymentdetPostcode").value = getField("PersonalPostcode").value

            else getField("paymentdetPostcode").value = "";

            • 4. Re: Auto-fill Address Details
              try67 MVP & Adobe Community Professional

              You need to place the codes in blocks, like so:

               

              if (getField("PayerMember").value=="Yes") {

              // all the lines to populate the fields go here

               

              } else {

              // all the lines to clear the fields go here

               

              }

              • 5. Re: Auto-fill Address Details
                ajmayjnr Level 1

                Like this?

                 

                if (getField("PayerMember").value=="Yes")

                {getField("paymentdetTitle").value = getField("Title").value

                getField("paymentdetName").value = getField("PersonalName").value

                getField("paymentdetSurname").value = getField("PersonalSurname").value

                getField("paymentdetAddress").value = getField("PersonalAddress").value

                getField("paymentdetSuburb").value = getField("PersonalSuburb").value

                getField("paymentdetState").value = getField("PersonalState").value

                getField("paymentdetPostcode").value = getField("PersonalPostcode").value

                }

                 

                else {getField("paymentdetTitle").value = "";

                getField("paymentdetName").value = "";

                getField("paymentdetSurname").value = "";

                getField("paymentdetAddress").value = "";

                getField("paymentdetSuburb").value = "";

                getField("paymentdetState").value = "";

                getField("paymentdetPostcode").value = "";

                }

                • 6. Re: Auto-fill Address Details
                  ajmayjnr Level 1

                  Tested and it worked!  Awesome... Try67, that is 2 big lessons in 24 hours for me.  Thank you so very much!

                  • 7. Re: Auto-fill Address Details
                    try67 MVP & Adobe Community Professional

                    Correct.