I'm trying to figure out the right script for making text box tiers essentially.
"Text1" is the lowest tier, and the last wanted option.
"Text2" is the preferred information.
I want to make it so that "Text3" shows "Text2", but if it's not available, "Text1" fills it in.
Use this code as your field's custom calculation script:
var v1 = this.getField("Text1").valueAsString;
var v2 = this.getField("Text2").valueAsString;
event.value = (v2=="") ? v1 : v2;
Hmm, it's not working for some reason?
Text 3 stays empty?
No, as I wrote, this needs to be used as the custom calculation script (of Text3).
Realizing this now, but having another hiccup
Text3 didn't show Text1 or Text2 immediately. It only showed Text2 after I started to put content in Text3 then deleted it. Is there any way to have it show up automatically?
It should happen automatically, unless Text1 or Text2 have calculated values as well. If that's the case you need to fix the fields calculation order so that Text3 is calculated either both of those fields.
How would I remove those calculations? There shouldn't be any. As it stands both Text1 and Text2 are marked as "Field value is not validated" under validate.
Look under their Calculate tab, not Validate.
Thank you!! This fixed everything Hope you have a wonderful day/night