These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

show/hide not applying globally?

cfinley
Registered: Jan 9 2008
Posts: 70
Answered

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

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Global binding only applies to the field data, not any of the other field properties. These have to be set separately. See this post:

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

cfinley
Registered: Jan 9 2008
Posts: 70
Thanks! The resolveNode() took a minute to figure out, but once I got it set up properly it works like a charm!

for anyone else with this problem, this is what I did:

set a pair of radio buttons - in the first for the click event:

xfa.resolveNode("BagQty[0]").presence = "visible"
xfa.resolveNode("BagQty[1]").presence = "visible"
xfa.resolveNode("BagQty[2]").presence = "visible"
xfa.resolveNode("BagQty[3]").presence = "visible"
xfa.resolveNode("BagQty[4]").presence = "visible"
xfa.resolveNode("BagQty[5]").presence = "visible"
xfa.resolveNode("CaseQty[0]").presence = "invisible"
xfa.resolveNode("CaseQty[1]").presence = "invisible"
xfa.resolveNode("CaseQty[2]").presence = "invisible"
xfa.resolveNode("CaseQty[3]").presence = "invisible"
xfa.resolveNode("CaseQty[4]").presence = "invisible"
xfa.resolveNode("CaseQty[5]").presence = "invisible"

then swapped BagQty/CaseQty for the click event in the 2nd radio button

and just like that, now when someone picks a part number from the dropdown, the radio buttons go back and forth between displaying the different Bag/Case quantities
cvanmech
Registered: Jan 9 2009
Posts: 17
ResolveNode in a Javascript.

I have following code in FormCalc written.
this is a multi instance form which check that an start is smaller then the end time.
when this is not the case the time entered is blanked.



var t3 = Time2Num(data.p1.Task.end_time[*].formattedValue, "HH:MM:SS" )
var t4 = Time2Num(data.p1.Task.start_time[*].formattedValue, "HH:MM:SS" )


//data.p1.#subform.Table3.Row1.start_time[*]
if ( ( t3 < t4 &( t3 <> 0)) or t4 == 0)then
$ = null
endif


I'm trying to translate this code to Javascript with a "resolveNode" but I don't succeed.

Can somebody help