Expand my Community achievements bar.

Multiple conditions possible?

Avatar

Level 2

Form Options

Checkboxes

Ed:  subform 1 visible, else hidden

Drive:  subform 2 visible, else hidden

Group1 radio buttons

DSno:   clears radio button selections

DS5:  subform 3 visible, else hidden

DS9:  subform 4 visible, else hidden

Group2 radio buttons

Fee1:  subform5 visible, else hidden

Fee2:  subform6 visible, else hidden

Subform7   creates spacing on the form

Subform8    creates spacing on the form

Selecting a checkbox is optional

The checkboxes and radio buttons control what subforms appear on the form.  Subform7 and subform8 create spacing so signatures are not left hanging if the form goes to 2 pages.

The conditions below are what I’m trying to achieve:

if Fee1 and DS5 are selected subform8 will be hidden

if Fee1 and DS9 are selected subform 8 will be hidden

all other selection combinations when Fee1 is selected, subform 8 will be visible.

If Fee1 is not selected subform8 will be hidden

If Fee2 and DS5 and Ed and Driving are selected subform 7 will be hidden

If Fee2 and DS9 and Ed and Driving are selected subform 7 will be hidden

All other selection combinations when Fee1 is selected, subform 7will be visible.

If Fee2 is not selected subform 7 will be hidden

I’ve tried various If then else statements and switch statements, but cannot get the right combination. Is what I’m trying to do possible? If so, can someone lead me in the right direction?

8 Replies

Avatar

Former Community Member

Post your sample form and I will give it a try.

Paul

Avatar

Level 2

After re-reading my post, I wanted to add clarification on the following 2 conditions:

if Fee1 and DS5 are selected subform8 will be hidden

if Fee1 and DS9 are selected subform8 will be hidden

Suform8 will be hidden only when DS5 or DS9 is the only selection made. If either is selected with other conditions, subform8 will be visible.

Also, on my post, I used different names for the subforms and controls. I thought using subform1. subform2 .... would make my question easier to understand.

Thank you for your assistance

Avatar

Former Community Member

I think you may have posted the wrong form. I do not see a field called fee or DS5

Paul

Avatar

Level 10

I don't have time to take a look at the form, but I think you can get the effect you are looking for using if...else statements and using the javascript && (and) and || (or) operators.

if (Fee1==1 && DS5==1) {

     subform8.presence="hidden";

}

Hope that helps!

Avatar

Level 2

HI Paul.

I'm sorry for the inconvenience. In my post, I used field names that I

thought would be easier to understand and I guess I've complicated my request

for help.

Below are the actual names of the fields that are on my form. Hope it makes

more sense now.

edDriveG Check Boxes

Ed: EducationSubform

Drive: DrivingSubform

drugG radio buttons

no: clears radio button selections

five: Drug5Subform visible, else hidden

nine: Drug9Subform visible, else hidden

feesG radio buttons

conversion: ConversionSubform visible, else hidden

referral: ReferralSubform visible, else hidden

Subforms

Space creates spacing on the form

SpaceC creates spacing on the form

Selecting a checkbox is optional

The checkboxes and radio buttons control what subforms appear on

page1Subforrm. Space and SpaceC subforms create spacing so signatures are

not left hanging if the form goes to 2 pages.

The conditions below are what I’m trying to achieve:

Selecting RB conversion:

Subform Space will be hidden when RB conversion is selected

if RB conversion and RB five are selected subform SpaceC will be hidden

if RB conversion and RB nine are selected subform SpaceC will be hidden

with all other combinations of RB and checkbox selections SpaceC will be

visible. SpaceC is only hidden when RB conversion and RB five or RB nine are

the only options selected.

If RB conversion is not selected SpaceC will be hidden

Selecting RB referral

If RB referral and RB five and checkboxes Ed and Drive are selected subform

Space will be hidden

If RB referral and RB nine and checkboxes Ed and Drive are selected subform

space will be hidden

All other selection combinations when RB referral is selected, subform space

will be visible.

If RB referral is selected subform space2 will be hidden

Thank you.

Marlene Justus

General Employment Enterprises, Inc.

One Tower Lane, Suite 2200

Oakbrook Terrace, IL 60181

P - 630 954 0404

F - 630 954 0447

Avatar

Former Community Member

Ok I think I see what is wrong. There is nothing wrong with your code but you have put your code on the click event of the checkbox group. When that event fires the value for the checkbox has not been set yet. Move your code over to the change event of the RadioButton group and it will work just fine.

Also in looking at your form you hav eexposed another issue that existed in earlier versions of Designer. There is a designer instruction that gets repeated thousands of times making your form huge (14 Mgs). This will affect the performance of Designer as well as Acrobat. You do not see the issue in the PDF because of the compresion that is occurring. If you want to validate this just open th eform and look at the XML view. Scroll through there and you wil see what I am refering to. I cleaned your form and have included the cleaned version here. Make any changes to this one.

Paul

Avatar

Level 2

Hi Paul,

First, thank you for cleaning up my form.

Now, I'm still trying to get it to work the way I envision.

I put the following code in the form1.Data.options.drugG.Drug change event:

if(this.rawValue == 1 && form1.Data.options.feesG.fees == 2) {form1.Page1Subform.Space.presence = "hidden";} else {form1.Page1Subform.Space.presence = "visible";}

and this code in the form1.Data.options.feesG.fees change event:

if(this.rawValue == 1 && form1.Data.options.drugG.Drug.rawValue == 2) {form1.Page1Subform.Space.presence = "hidden";} else {form1.Page1Subform.Space.presence = "visible";}

Is there something wrong with the code? Where am I going wrong?  SubformSpace is not reacting to the code..

Thanks.

Avatar

Level 2

OK - after a week, I found the mistake - I had still had code on the click event - thanks again for all of your help.