Group checkboxes

Avatar

21-10-2008

Hello Gurus

Is there anyway in livecycle designer to group checkboxes? I have a group of 10 check boxes where in I should allow users to select a maximum of 5 check boxes. If they try to check a 6th check box a message box should be displayed.

Replies

Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

09-09-2009

So instead of having checkboxes that you want to limit to 2 selections (you will have to write code to accomplish this), why not put the selections in a Dropdown list. They can only choose one item in the list but you could have 1st performance and 2nd performance dropdowns.

Make sense?

paul

Highlighted

Avatar

Avatar

ocen12

Avatar

ocen12

ocen12

09-09-2009

Humm

I am not sure how your overgiven values look like. If you overgive 1 as clicked and 0 as unclicked, why don't you make an invisible decimalfield couting up all your checkboxes. I think that method is quite easy...

(Javascript calculate)

Decimalfield1.rawValue = Checkbox1.rawValue + Checkbox2.rawValue etc.

(Look that you got the correct names)

In the checkboxes you simply add the line (Javascript/change):

if (Decimalfield1.rawValue > 2) {this.rawValue = null; }

The cross will vanish then... You could add an app.alert if you'd like...

Hummhumm...

Maybe I'll make later another post because I've got a problem too with these grouped checkboxes... (in my case at least 1 option has to be checked... and I am just thinking how to invoke a nullTest = "error")

But after I thought a bit about it... most likly I can do it myself

Nope... sorry... bad idea, didn't work...

The problem: I'd like to script if none of a group of checkboxes is clicked, there should be a nullTest = "error";

The real problem is not to evoke the nullTest = "error" but that I am not sure, if in some versions of AdobeReader there might be a hint, which field(s) did evoke that error...

Right now I want to create an invisible field that will get mandatory if one of the groups has no checks and get optional if they are all checked...

Or is there any possibility to get the message turning up with script only?

Highlighted

Avatar

Avatar

djaknow

Avatar

djaknow

djaknow

09-09-2009

Hi ocen,

You could put a script on preprint or presave simply checking the box you want mandatory if all checkboxes are null.

Highlighted

Avatar

Avatar

rll111

Avatar

rll111

rll111

09-09-2009

Paul, Thanks for the suggestion. Would I still be able to make the appropriate subform become visible when the selection was made from a dropdown list?

Randee Leightcap

Graphic Artist

rleightcap@aclsys.org

Atlantic County Office of Cultural & Heritage Affairs

40 Farragut Avenue, Mays Landing, NJ 08330

(609)625-2776, extension 6339, FAX (609)625-5908

www.aclink.org/culturalaffairs

Atlantic County Library System, Community Relations Section

306 E. Jimmie Leeds Road, Galloway, NJ 08205, (609)652-1956, FAX (609)652-1863

www.atlanticlibrary.org

Highlighted

Avatar

Avatar

rll111

Avatar

rll111

rll111

09-09-2009

Thanks for replying, but I don't understand anything in your message. Could you translate it for someone who doesn't program?

Randee Leightcap

Graphic Artist

rleightcap@aclsys.org

Atlantic County Office of Cultural & Heritage Affairs

40 Farragut Avenue, Mays Landing, NJ 08330

(609)625-2776, extension 6339, FAX (609)625-5908

www.aclink.org/culturalaffairs

Atlantic County Library System, Community Relations Section

306 E. Jimmie Leeds Road, Galloway, NJ 08205, (609)652-1956, FAX (609)652-1863

www.atlanticlibrary.org

Highlighted

Avatar

Avatar

ocen12

Avatar

ocen12

ocen12

09-09-2009

@djaknow

Doesn't work.

1) I don't wanna check any boxes.

2) Have you tried to mail it? I did... what happened: The Checkbox got a red border (memo: third kind of border I've seen at a checkbox) and the mailbox opened... no error message at all.

3) I printed maaaaany forms without the mandatory boxes filled ;D (Luckily the ones I make these forms for don't want print validation, just the xml scheme.)

4) Even if I provoke an error message (no problem doing so) I am not sure if there is no version of LCD which will give a hint to which field is not filled out.

And that is what I am afraid of since I just had some problem with different AdobeReader versions...

If someone could tell me that I don't have to stress myself about point 4 it won't be any problem.

Highlighted

Avatar

Avatar

ocen12

Avatar

ocen12

ocen12

09-09-2009

Here... isn't the best solution but it is one.

I liked to have a look at your form... learned a little thing ;D

(If you want another question to appear, just change it in the scripts...)

Hope my question will be answered soon too.

Highlighted

Avatar

Avatar

rll111

Avatar

rll111

rll111

09-09-2009

Thanks for the solution! I'm not picky about free help! And thanks for the advice on the mandatory fields. I don't feel anywhere near where to send it, so I hadn't tried to email it yet. I'll try to be very careful about the wording of the error messages.

Randee Leightcap

Graphic Artist

rleightcap@aclsys.org

Atlantic County Office of Cultural & Heritage Affairs

40 Farragut Avenue, Mays Landing, NJ 08330

(609)625-2776, extension 6339, FAX (609)625-5908

www.aclink.org/culturalaffairs

Atlantic County Library System, Community Relations Section

306 E. Jimmie Leeds Road, Galloway, NJ 08205, (609)652-1956, FAX (609)652-1863

www.atlanticlibrary.org

Highlighted

Avatar

Avatar

ocen12

Avatar

ocen12

ocen12

10-09-2009

@rll111

Try to understand the codings you have just a little bit. With these you can do quite much in a form already.

If you ever wanna do more forms you'll have to learn it at least a little bit. ^^

@djaknow

Sorry if I sounded rude... I'm more mad about myself... I was content with my solution (which was MUUUUUUCH more difficult to conceptionate than yours), just to see when the form is opened with another version of the reader I got doubled borders...

(A problem that appears with radiobuttons is, that if they are mandatory in flowable forms the border will show up in higher versions of the AdobeReader and hide in the lower ones. Since I dislike that huge border around everything I wanna make small ones. Lots of requests to those small radiobuttons I know... but it all wouldn't be a problem if I could be sure that no Reader version would give a hint to which field is not filled out.)

Highlighted

Avatar

Avatar

djaknow

Avatar

djaknow

djaknow

10-09-2009

Hi ocen,

Don't worry about the rude thing, I know how frustrating it can be trying to pull a solution out of thin air.

As for the radio buttons, have you considered using checkboxes and scripting them to be mutually exclusive like radio buttons? All it takes is:

if (this.rawValue == 1) {

     otherCheckBox1.rawValue = 0

     otherCheckBox2.rawValue = 0

     etc.....

}

This is the method I use for exclusion groups. I find it much easier to script other dependencies (such as making text fields open/readOnly) on checkboxes rather than using radio buttons.