Hi
I have 2 sets of 6 text field, which are both set to global binding so one value appears in all 6 - the 2 fields are directly on top of each other, and I set a combo box to show one and hide the other based on selection:
example:
switch(xfa.event.newText) {
case 'Bag Label':
xfa.form.SixPage.Page1.BagQty.presence = "visible";
xfa.form.SixPage.Page1.CaseQty.presence = "invisible";
break;
case 'Case Label':
xfa.form.SixPage.Page1.BagQty.presence = "invisible";
xfa.form.SixPage.Page1.CaseQty.presence = "visible";
break;
default:
xfa.form.SixPage.Page1.BagQty.presence = "visible";
xfa.form.SixPage.Page1.CaseQty.presence = "invisible";
break;
}
so there are boxes BagQty [0]-[5] and CaseQty [0]-[5] - But instead of hiding all CaseQty fields, it only hides/shows CaseQty[0], with the other 5 visible at all times - how can I set the hide/show to apply to all 6 boxes? (without changing names and losing my global binding!)
Another thing is it seems when I set the fields to visible by default, it has no trouble hiding the field, but if i set to invisible it will not show at all, even when should be visible by the change event
please bear in mind I am working in a pdf with art background so LiveCycle does not let me use subforms
Finally, is there a way to use radio buttons instead of the combo box? I've seen a few examples of hide/show with radio buttons, but they were either for AcroForms, or used a subform, neither of which would work in my situation.
thanks
http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=12320
In your case, the combobox or radio button is just used as a trigger for the behavior. The code could be placed in either type of control. In fact, by changing the radio buttons export value you could use exactly the same code, although it would be easier to place sections of your existing code into the radio button "click" event.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script