1 Reply Latest reply on Dec 23, 2015 4:55 AM by try67

    auto populate data from one field to another with checkbox

    Shekharmine Level 1

      ssaammpp.PNG

      see the above form

      i want action script for that check box.

      user can fill the "patient details above"

      when the check box checked, then all the text fields should filled with above fields.

      and make the fields "read only" cannot be editable.

      if unchecked, then user can input different details.

        • 1. Re: auto populate data from one field to another with checkbox
          try67 MVP & Adobe Community Professional

          As the Mouse Up action of the check-box you can use something like this:

           

          if (event.target.value=="Off") {
              this.getField("FirstName2").value = "";
              this.getField("FirstName2").readonly = false;
          } else {
              this.getField("FirstName2").value = this.getField("FirstName1").valueAsString;
              this.getField("FirstName2").readonly = true;
          }
          

           

          Of course, you'll need to adjust the field names to match those in your file, and duplicate the code for all of the fields.