Here is the script I have:
MonthlyCableHPSD.#subform[2].Materials_Used::change - (JavaScript, client)
switch (xfa.event.newText)
{
case "Cable":
Cable.presence = "visible";
Cable_BOM_Code.presence = "visible";
Jacks.presence = "invisible";
Jacks_BOM_Code.presence = "invisible";
Face_Plates_and_Boxes.presence = "invisible";
FacePlate_BOM_Code.presence = "invisible";
Misc.presence = "invisible";
Misc_BOM_Code.presence = "invisible"; break;
default:
break;
}
I have a drop down list name "Materials_Used" in there an option for "Cable". If you select Cable a second drop down becomes visible, and when you select a topic out there it will auto populate a textfield. Everything works just fine. But when I put it into a table nothing works no more. I tried adding the the script as below:
MonthlyCableHPSD.#subform[2].Materials_Used_Table.Row1.Materials_Used::change
switch (xfa.event.newText)
{
Materials_Used_Table.Row1.Cable.presence = "visible";
default:
break;
}
But still nothing works.
Does someone know the fix for this?
It should work without having to specify the row in the reference. If Materials_Used and Cable objects are in the same row, then it should work as per the original script.
In the second script block you don't have a case"Cable":, which may be throwing it.
The easiest way to make sure that you have a correct object reference in your script is to let LC Designer input the reference into the script for you. First select the object that you are putting script into. Click into the script editor, then hover the mouse over the object you want to reference. Press and hold Control. The mouse will change to a 'V', now click the object and LC Designer will insert the object reference.
Where objects are in the same row, the minimum reference would be the object's name.
Lastly, make sure that the form is saved as a Dynamic XML Form in the save as dialog.
Hope this helps,
Niall
Assure Dynamics