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

Showing subform from Radio Button

jennyb
Registered: Nov 15 2010
Posts: 6

I have been trying to work this out and have tried many sripts to no avail. I have 3 subforms and 3 radio buttons, depending which radio button is selected should determine which subform is viewable. All the subforms are currently not visible, but I cannot get them to show. I have searched extensively both in this forum and google, but only found a solution for a yes / no, not 3 subforms / choices.
The most recent script I tried on click is:
 
TopmostSubform.Page1.page1subform.subject.Subject::click - (JavaScript, client)
if (this.rawValue == 1){
_RHW.presence == "visible";
} else {
 
_RHW.presence == "hidden";
 
}
 
if (this.rawValue == 2){
_DSP.presence == "visible";
} else {
 
_DSP.presence == "hidden";
 
}
 
if (this.rawValue == 3){
_WRP.presence == "visible";
} else {
 
_WRP.presence == "hidden";
 
}
  
Where 1, 2 and 3 are the bindings on the radio button choices.
 
Any help would be gratly appreciated.

My Product Information:
LiveCycle Designer, Windows
SLDC
Registered: Oct 25 2010
Posts: 70
Two equals signs (==) are used to indicate equality; to -set- a variable or property, use one equals sign (=).

Instead of

_RHW.presence == "visible";

try

_RHW.presence = "visible";
jennyb
Registered: Nov 15 2010
Posts: 6
Unfortunately, changing this still did not resolve my problem.
SLDC
Registered: Oct 25 2010
Posts: 70
Try:

switch(this.rawValue) {
case 1:
_RHW.presence = "visible";
break;
case 2:
_DSP.presence = "visible";
break;
case 3:
_WRP.presence = "visible";
break;
}

jennyb
Registered: Nov 15 2010
Posts: 6
Thanks for the suggestion SLDC, however it is still not working. I have applied the above code to the radio button group, which appears as an exclusion group. the binding to the items are specified 1 , 2 and 3. The form is saved as a dynamic form (pdf). I don't know what I am missing to get this to work.
SLDC
Registered: Oct 25 2010
Posts: 70
Can you post the file somewhere? I'd be happy to look at the actual form and code.

Also: it can be useful to throw some temporary code into your scripts to help you figure out what's happening. Try putting this in:

app.alert("this.rawValue is currently "+this.rawValue+".");

It'll pop up a window showing you the current rawValue, so you can make sure that it's turning out the way you expect.
jennyb
Registered: Nov 15 2010
Posts: 6
Hi SLDC,
I have uploaded it to google docs. Thank you so much for this.

https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B_xmcDoPHNsAMTM5ZTM3Y2ItYTBhZi00YzY4LWE5NTItMWI3YzA0ZGE0ZGYy&hl=en&authkey=CPzE9-ANCheers.
pforms
Registered: Nov 17 2009
Posts: 87
I cannot open your form. Send me an email address and I'll forward a sample for you to examine
Masi
Registered: Sep 18 2008
Posts: 22
When you use _WRP you don't actually reference the subform but the instance manager of the subform. Try to remove the '_' mark from the start of the subform reference like this:

switch(this.rawValue) {
case 1:
RHW.presence = "visible";
break;
case 2:
DSP.presence = "visible";
break;
case 3:
WRP.presence = "visible";
break;
}
jennyb
Registered: Nov 15 2010
Posts: 6
Thanks pforms, I can be contacted on callJenny [at] gmail [dot] comThanks Masi, I tried your changes above, still did not work.

I am hopefully getting training in the new year for Livecycle designer ES2. until then . . .