Answered
Hi folks,
Alright, after banging around for a bit, here's what I've got -- an ugly nested if-else structure that's trying to change the color value of a text field based on what's entered. If there's nothing entered or it's a null value, it should reset the field back to blank. It's currently not working, of course:
form1.Page1.ProjectStatus.ProStatusGroup.txtRating1::change - (JavaScript, client) if (ProjectStatus.ProStatusGroup.txtRating1.rawValue == "G") { this.resolveNode("ui.#textEdit").border.fill.color.value = "0,255,0"; // Green } else { if (ProjectStatus.ProStatusGroup.txtRating1.rawValue == "Y") { this.resolveNode("ui.#textEdit").border.fill.color.value = "255,255,0"; // Yellow } else { if (ProjectStatus.ProStatusGroup.txtRating1.rawValue == "R") { this.resolveNode("ui.#textEdit").border.fill.color.value = "255,0,0"; // Red } else { if (ProjectStatus.ProStatusGroup.txtRating1.rawValue == "P") { this.resolveNode("ui.#textEdit").border.fill.color.value = "255,0,255"; // Purple } else { if (ProjectStatus.ProStatusGroup.txtRating1.rawValue == "B") { this.resolveNode("ui.#textEdit").border.fill.color.value = "0,255,255"; // Blue } else { if ((ProjectStatus.ProStatusGroup.txtRating1.rawValue == null) || (ProjectStatus.ProStatusGroup.txtRating1.rawValue == "")) { this.resolveNode("ui.#textEdit").border.fill.color.remerge; } } } } } }
No error message on the JavaScript Console in Acrobat at this time. This is a Designer form, created in Adobe Designer ES.
Thanks in advance for any corrections or advice. :)
For a big nested if...else like that I think it would be better to use a switch() statement.