Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Auto-fill text into field if any data is entered in another

Community Beginner ,
Dec 15, 2016 Dec 15, 2016

I am creating a form for work, and I would like to set it up so if someone fills out a certain field with any data at all, it will populate a set text into another field.  I have searched the forums for this, and have seem similar answers, but they are all based on varying data being entered and output.  I am just unsure of how I would set the field to accept any input as opposed to a set text.

For example, if I have fields A, B, and C, where A would be the field they would be entering text.  I would like it so regardless of what is entered into field A, fields B and C will populate with a set text.  So I could type "Hello" into A, and B would populate with "Hi", and C would populate with "Bye", but if I were to type "Adobe" (or any other text) into field A, the other two would still fill with "Hi" and "Bye".

TOPICS
PDF forms
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Dec 15, 2016 Dec 15, 2016

OK. In that case you use this custom Calculation script for each of them:

event.value = this.getField("A").valueAsString=="" ? "" : "Hi";

event.value = this.getField("A").valueAsString=="" ? "" : "Bye";

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 15, 2016 Dec 15, 2016

And if the A field is empty, do you want the user to be able to enter a value into B and C, or just have them as empty automatically?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 15, 2016 Dec 15, 2016

They would always be empty until there is something entered into field A.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 15, 2016 Dec 15, 2016

OK. In that case you use this custom Calculation script for each of them:

event.value = this.getField("A").valueAsString=="" ? "" : "Hi";

event.value = this.getField("A").valueAsString=="" ? "" : "Bye";

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 15, 2016 Dec 15, 2016

This worked!  Thank you so much!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 13, 2017 Jun 13, 2017
LATEST

Hello I have a similar situation,

Field A + Field B = Auto Populate Field A in Field C

if Field B is empty so would Field C

therefore I need Field B to trigger Field C.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines