Hide text fields if another text field is blank but copy another field is the same text field has information
Copy link to clipboard
Copied
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.
Height1 | UPC1 |
---|---|
Height2 | UPC2 |
Height3 | UPC3 |
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!
Copy link to clipboard
Copied
Do you want the user to be able to manually overwrite those values, or should they be automatic?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
This worked exactly how I needed. Thank you!

