Skip to main content
Participating Frequently
October 27, 2022
Answered

Auto-populating text field from multiple text fields

  • October 27, 2022
  • 1 reply
  • 923 views

Hello,

I am trying to find a script that will help me auto populate a text field based on the information in multiple text fields. I am working on a form that has a read-only text field that needs to be autofilled based on the information from one of four different text fields.  For example, on page 1 textfieldA is read-only and needs to be filled based on the information from text fields later in the form so that if  text2 is selected it fills textfieldA, if text 3 is selected it fill textfieldA, or text 4 is selected it fills textfieldA.  Only one field on page 9 may be selected at once and are calculated with a checkbox.  Any help will be appreciated.

This topic has been closed for replies.
Correct answer Nesa Nurani

If only one can be filled at a time use this as custom calculation script of textfieldA:

event.value = this.getField("Text2").valueAsString+this.getField("Text3").valueAsString+this.getField("Text4").valueAsString;

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
October 27, 2022

If only one can be filled at a time use this as custom calculation script of textfieldA:

event.value = this.getField("Text2").valueAsString+this.getField("Text3").valueAsString+this.getField("Text4").valueAsString;

Participating Frequently
October 27, 2022

Perfect! Thank you again for the help!