Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Check box - When yes is checked no will uncheck

Avatar

Level 2

I need help figuring out how to make the check boxes to where only one option can be checked at a time, either yes or no. I am using check

boxes rather than radio buttons because i also need them to be able to be unchecked by re-clicking on them.

I am fairly new to this i would need a step by step for the most part. Thank you!

13 Replies

Avatar

Level 4

What version of LiveCycle are you using?

Avatar

Level 2

9.0

Jenna Cooley

Quality Assurance

Cascade Steel Rolling Mills

Ext. 8162 Cell: 503-474-7114

Avatar

Level 3
Level 3

Hi,

Just add the following script on the click event of checkbox:

Let's suppose their are two checkboxes CheckBox1 and CheckBox2.

1: On click of CheckBox1 set the value of CheckBox2 as null

form1.firstpage.CheckBox2.rawValue=null

2:On click of CheckBox2 set the value of CheckBox1 as null

form1.firstpage.CheckBox1.rawValue=null

and second issue to uncheck by re-clicking on them is bydefault provided with checkbox.

Thanks

Avatar

Level 2

Hi, I tried the scripts you had suggested and it is not working for me... I don’t know if I am putting them in the wrong location? I pulled up the script editor for each object and put them in but when I preview the form it still gives the option to check both. Also I need to know how to script for 3 check box options

Jenna Cooley

Quality Assurance

Cascade Steel Rolling Mills

Ext. 8162 Cell: 503-474-7114

Avatar

Level 3
Level 3

Sendme your form i will try to fix your problem.

abhishekgonda@gmail.com

Thanks

Avatar

Level 2

Jenna Cooley

Quality Assurance

Cascade Steel Rolling Mills

Ext. 8162 Cell: 503-474-7114

Avatar

Level 2

I did not mean to send that ... is there a way to delete your own posts?

Avatar

Level 4

I use the Actions Builder menu under tools to create an action where is one checkbox is checked, the other is unchecked and vice versa. I think the action builder is new to this version of LiveCycle and that's why I asked you which version you had. Everyone seems to really like writing script to program things but this version of LiveCycle has done alot of that for you.

Let me know if you have the action builder and then I can give you more directions for how to make those actions.

Avatar

Level 2

I tried doing that I was putting the action as when CheckBox 3 is checked CheckBox 4 is disabled. But then I cant uncheck the box after I check it. Which result are you using for your action?

Jenna Cooley

Quality Assurance

Cascade Steel Rolling Mills

Ext. 8162 Cell: 503-474-7114

Avatar

Level 4

You would have to make it: When CheckBox 3 is checked, CheckBox 4 is Unchecked. When CheckBox 4 is checked, CheckBox 3 is unchecked. I think that would work.

> Date: Fri, 1 Jul 2011 10:22:08 -0600

From: forums@adobe.com

To: jeanetteeichhorn@hotmail.com

Subject: Check box - When yes is checked no will uncheck

I tried doing that I was putting the action as when CheckBox 3 is checked CheckBox 4 is disabled. But then I cant uncheck the box after I check it. Which result are you using for your action?

Jenna Cooley

Quality Assurance

Cascade Steel Rolling Mills

Ext. 8162 Cell: 503-474-7114

>

Avatar

Level 10

Here is the most optimal way to do this:

You can use radio buttons and just change their appearance. You can change the Round shape to Square and Check type is "Check"

Nith

Avatar

Level 2

I originally had radio buttons, but I could not uncheck them after they had been checked so I changed them to checkboxes as many had suggested.

Jenna Cooley

Quality Assurance

Cascade Steel Rolling Mills

Ext. 8162 Cell: 503-474-7114

Avatar

Level 4

Hi Jenna,

     I have sent you a sample to your hotmail address, and i just added a simple script to make the collection of check boxes mutual exclusive.


Sample Script on each Check box

form1.PageOne.collectionSub.CheckBox1::click - (JavaScript, client)
if(CheckBox2.rawValue == "1" || CheckBox3.rawValue == "1" || CheckBox4.rawValue == "1"){
     this.rawValue = "0";
}

form1.PageOne.collectionSub.CheckBox2::click - (JavaScript, client)
if(CheckBox1.rawValue == "1" || CheckBox3.rawValue == "1" || CheckBox4.rawValue == "1"){
     this.rawValue = "0";
}


form1.PageOne.collectionSub.CheckBox3::click - (JavaScript, client)
if(CheckBox2.rawValue == "1" || CheckBox1.rawValue == "1" || CheckBox4.rawValue == "1"){
     this.rawValue = "0";
}

form1.PageOne.collectionSub.CheckBox4::click - (JavaScript, client)
if(CheckBox2.rawValue == "1" || CheckBox3.rawValue == "1" || CheckBox1.rawValue == "1"){
     this.rawValue = "0";
}

Please let me know, whether am i understanding correct.

Thank You