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

Hide text fields if another text field is blank but copy another field is the same text field has information

Community Beginner ,
Jan 11, 2019 Jan 11, 2019

I don't have much experience with Javascript, but I'm wanting to do the following and was wondering if anyone can help. All of the fields I have are text fields with no formatting.

Height1UPC1
Height2UPC2
Height3UPC3

My text fields look like what's shown above. I wanted to make it so that for Height2 and Height3, the same exact information from Height1 is carried over, but is blanked out if UPC2 or UPC3 are blank.

example1.

3"251012345600
3"251012345700
3"251012345800

example2.

3"251012345600
3"251012345700

Thanks a lot in advance!

TOPICS
PDF forms
729
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 ,
Jan 12, 2019 Jan 12, 2019

Do you want the user to be able to manually overwrite those values, or should they be automatic?

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 ,
Jan 13, 2019 Jan 13, 2019

I’m not sure if it can be done, but I‘d like the values (height2 and Height3) to be automatic, while others to be manual

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 ,
Jan 14, 2019 Jan 14, 2019

You can use this code as the custom calculation script of Height2, for example:

if (this.getField("UPC2").valueAsString=="") event.value = "";

else event.value = this.getField("Height1").valueAsString

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 ,
Jan 14, 2019 Jan 14, 2019
LATEST

This worked exactly how I needed. Thank you!

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