Like the title hints, i copy and past a working Drop Down and even when i rename everything, it does not work.
I have done both copy and pasting of the objects and creating them from scratch, with the same non-results.
I did not write the code, nor do i fully understand it, especially why its not working.
This is the one that works:
DD is the Drop down
Ordering is the text area to the right of the drop down. It should be shown or hidden depending if the Drop Down value is Yes (1) or No (0), respectively.
Row is shown on a different page and uses an add/remove function.
WORKING CODE:
form1.#subform[1].DDScrubs4me::change - (JavaScript, client)
if ($.boundItem(xfa.event.newText) == "Yes") {
this.resolveNode('Table1._Scrubs4MeRow').addInstance(1);
if (xfa.host.version < 8) {
xfa.form.recalculate(1);
}
this.resolveNode("Scrubs4meOrdering").presence = "visible";
}
if ($.boundItem(xfa.event.newText) == "No") {
this.resolveNode("Scrubs4meOrdering").presence = "invisible";
this.resolveNode('Table1._Scrubs4MeRow').removeInstance(0);
if (xfa.host.version < 8) {
xfa.form.recalculate(1);
}
}
//+ GENERATED - DO NOT EDIT (ID:B66FA27E-80E0-4049-A24A-2B81F5F29055 CRC:973936563)
if ($.boundItem(xfa.event.newText) == "Yes" && this.resolveNode("PromptOff").rawValue == "0" && (this.resolveNode("Scrubs4meOrdering").rawValue == null || this.resolveNode("Scrubs4meOrdering").rawValue == "")) {
xfa.host.messageBox("Please enter your facility's entity code", "Code needed.", 3);
}
//-
This is the one that was copied and does not work:
CODE FROM COPIED DROP DOWN WITH OBJECTS RENAMED:
form1.#subform[1].DDSNH::change - (JavaScript, client)
if ($.boundItem(xfa.event.newText) == "Yes") {
this.resolveNode('Table1._SNHRow').addInstance(1);
if (xfa.host.version < 8) {
xfa.form.recalculate(1);
}
this.resolveNode("SNHOrdering").presence = "visible";
}
if ($.boundItem(xfa.event.newText) == "No") {
this.resolveNode("SNHOrdering").presence = "invisible";
this.resolveNode('Table1._SNHRow').removeInstance(0);
if (xfa.host.version < 8) {
xfa.form.recalculate(1);
}
}
if ($.boundItem(xfa.event.newText) == "Yes" && this.resolveNode("PromptOff").rawValue == "0" && (this.resolveNode("SNHOrdering").rawValue == null || this.resolveNode("SNHOrdering").rawValue == "")) {
xfa.host.messageBox("Please enter your facility's entity code", "Code needed.", 3);
}