Duplicate field via script, not global binding | Community
Skip to main content
New Participant
March 31, 2021
Solved

Duplicate field via script, not global binding

  • March 31, 2021
  • 1 reply
  • 945 views

I have a form where we need a field on one page to be autofilled with the text entered in another.

The difficulty is we need to allow the user to be able to override the second, autofilled field if need be, so using the same field name and setting binding to global doesn't allow for that.

 

I've tried putting a script in set to calculate.

 

First field is Year1_text.   Value is User Enter-Required

Second field (to be autofilled) is Year1.  Value is set to Calculated-User Can Override

Language is set for Javascript

 

script on Year1 field is:

this.rawValue=Year1_text.rawValue

 

I can't seem to get it to work.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kosta_Prokopiu1

This is something I woul place in the exit event of the first field. It also depends under which conditions field 2 should be filled by field 1.

Here is an example where I only fill field 1 if it is still empty, once filled with the same or a different content it will not be overwritten again.

I do this in the exit event of field 1 - as soon as the user steps out of the field it will be executed.

See if this works for you

 

   

1 reply

Kosta_Prokopiu1
Kosta_Prokopiu1Accepted solution
Employee
April 1, 2021

This is something I woul place in the exit event of the first field. It also depends under which conditions field 2 should be filled by field 1.

Here is an example where I only fill field 1 if it is still empty, once filled with the same or a different content it will not be overwritten again.

I do this in the exit event of field 1 - as soon as the user steps out of the field it will be executed.

See if this works for you

 

   

New Participant
April 1, 2021

No sorry, it's not working for me. arrrghhh

Is it perhaps because the two fields are in different subforms?