Expand my Community achievements bar.

SOLVED

Duplicate field via script, not global binding

Avatar

Level 2

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.

1 Accepted Solution

Avatar

Correct answer by
Employee

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

Kosta_Prokopiu1_0-1617259597911.png

 

   

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

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

Kosta_Prokopiu1_0-1617259597911.png

 

   

Avatar

Level 2

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

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