Skip to main content
Participant
May 4, 2023
Question

Duplicate and editable fields

  • May 4, 2023
  • 1 reply
  • 991 views

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.

 

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
May 4, 2023

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

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

Participant
May 4, 2023

Thank you. That works!