Skip to main content
JimFarlow
Participant
April 2, 2018
Answered

I created from that has form templates. I want to use JavaScript to control user entries but I don't know how to call the form fields because the names change.

  • April 2, 2018
  • 1 reply
  • 689 views

Looking for information on how to use JavaScript with form fields create from a form template. I don't know how to get the form field names as they change when they are create from a template.

Thanks

This topic has been closed for replies.
Correct answer try67

The simplest way to do it is to apply the following custom calculation script to this field:

if (event.target.name!="P3.CA PG 1 TEMP.recipient") event.value = this.getField("P3.CA PG 1 TEMP.recipient").valueAsString;

1 reply

try67
Community Expert
Community Expert
April 2, 2018

The names of spawned form fields are predictable. They contain the template name, the new page number and the original field name.

JimFarlow
JimFarlowAuthor
Participant
April 2, 2018

I have multiple template pages within this form. I have added buttons that allow the user to put different pages in different locations in the form. Example: This field "P3.CA PG 1 TEMP.recipient" can appear on multiple pages. I want to use JavaScript to transfer the value entered on page one to the other field(s) create on all other template pages.  

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
April 2, 2018

The simplest way to do it is to apply the following custom calculation script to this field:

if (event.target.name!="P3.CA PG 1 TEMP.recipient") event.value = this.getField("P3.CA PG 1 TEMP.recipient").valueAsString;