I am using Adobe LiveCycle Desinger 7 to design a form with the following JavaScript. The "initialize" event seems to work fine (i.e, the three objects are not displayed). However, the "Change" event does NOT seem to work. When I click on the chkNewStaff checkbox, a x appears in the checkbox, but the three specied objects are not displayed. What I would like is that when a user clicks on the chckNewStaff checkbox, the txtWorkstation, chkDesktop and chkLaptop controls are displayed; otherwise, they should not be displayed. What's wrong with my JavaScript code below? Thank you in advance for your prompt reply.
----- form1.#subform[0].chkNewStaff::initialize - (JavaScript, client) -----------------------------
txtWorkstation.presence = "invisible";
chkDesktop.presence = "invisible";
chkLaptop.presence = "invisible";
----- form1.#subform[0].chkNewStaff::change - (JavaScript, client) ---------------------------------
if (this.rawValue ==1) {
txtWorkstation.presence = "visible";
chkDesktop.presence = "visible";
chkLaptop.presence = "visible";
}
else
{
txtWorkstation.presence = "invisible";
chkDesktop.presence = "invisible";
chkLaptop.presence = "invisible";
}
However, this will only work if you form is saved as Dynamic.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script