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

Duplicate and editable fields

New Here ,
May 03, 2023 May 03, 2023

Hello, community!

 

I don't have the coding background and am trying to build a fillable form with some javascript. I am stuck where I have two fields, Field_A and Field_B. When I fill out Field_A, Field_B will automatically duplicate the same info. However, occasionally, Field_B will need to be different than Field_A (manually edited). The fields contain various characters (-1.50, +2.00, abcdf, etc.). 

This is what I am using in the Field_B custom calculation script, and it seems to work for duplication and editable, but once I edit different fields on the form, Field_B would jump back to the original value from Field_A.

 

event.target.value = this.getField("Field_A").valueAsString;

 

Thanks for the help.

 

TOPICS
Create PDFs , JavaScript , PDF , PDF forms
910
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
Community Expert ,
May 03, 2023 May 03, 2023

Use this in "Field_A" as 'Validate' script:

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

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
New Here ,
May 04, 2023 May 04, 2023
LATEST

Thank you. That works!

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