Showing text box based on whether text is typed in another text box
I have three text boxes named Text1, Text2 and Text3. I have another three text boxes named TextA, TextB and TextC. If text is typed into TextA, I want Text1 to be visible and Text2 and Text3 to be hidden. If text is typed into TextB, I want Text2 to be visible and Text1 and Text3 to be hidden. If text is typed into TextC, I want Text3 to be visible and Text1 and Text2 to be hidden.
I've tried using the following script, which works for four text boxes (Text1, Text2, Text A, TextB), but I can't modify to work when I add Text3 and TextC:
if (event.target.value == "") {
this.getField("Text2").display = display.hidden;
}
else {
this.getField("Text2").display = display.noPrint;
}
if (event.target.value == "") {
this.getField("Text1").display = display.noPrint;
}
else {
this.getField("Text1").display = display.hidden;
}
