I'm designing a dynamic form that will show one of two different groups of checkboxes depending on the value in a drop-down list. I'm wondering if I'm using the wrong event to trigger the change, since it seems to be out of sync. In testing, when I change the value to "Company2", I don't see a change (the "Company1HardwareKits" group is the default). When I change back to "Company1", I see the "Company2" group. The actual switch statement seems to be correct, so I'm wondering if it's just a timing issue based on the event being used.
EquiptReqForm.MainForm.ColleagueInfo.Company::change - (JavaScript, client)
// change presence of Company1 or Company2 hardware kits based on value of Company drop-down
switch (this.rawValue) {
case "Company1":
MainForm.HardwareReqs.Company1HardwareKits.presence = "visible";
MainForm.HardwareReqs.Company2HardwareKits.presence = "hidden";
break;
case "Company2":
MainForm.HardwareReqs.Company1HardwareKits.presence = "hidden";
MainForm.HardwareReqs.Company2HardwareKits.presence = "visible";
break;
default:
MainForm.HardwareReqs.Company1HardwareKits.presence = "visible";
MainForm.HardwareReqs.Company2HardwareKits.presence = "hidden";
break;
} // company switch
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]
The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script