Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

copy and lock

New Here ,
Sep 09, 2016 Sep 09, 2016

I am creating a fillable form.

I want people to be able to fill in box 1. I then want that to copy to box 2, but I want to lock box 2 so that the info can only be edited in one spot. Is there a way to do this?

Thanks

Lisa

TOPICS
Acrobat SDK and JavaScript , Windows
187
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 09, 2016 Sep 09, 2016
LATEST

As you should be aware, fields of the same name share many properties and value is one them. So you cannot use the same names for both fields. You need to give each field a different name and set the second field to "read only". If your fields are numeric values, this excludes items like SSN,, dates, times, postal codes, etc, one can just add the value of the first field to the second field using either "The field is the sum of the following fields:" or the "Simplified Field Notation". If the first field has any non-numeric values or leading zeros then one needs to either use the "Custom JavaScript calculation" or the "On Blur" action. Since this field  does not need to be recalculated each time any field is changed, I would use the "On Blur" Action of the first field, so the second field is only changed when the first field is changed. So you will be copying the focused field's value to the second field's value. A possible script is:

// copy the value of this field to the second field;

this.getField("Other_field_name").value = event.value;

You will have to change the "Other_field_name" to the actual name of the second field.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines