Change Dropdown Checkbox based on other component value

Avatar

Avatar
Validate 1
Level 1
bokenrosie
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
bokenrosie
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
bokenrosie
Level 1

19-09-2016

I'd like to put a check in a checkbox if a dropdown next to it has been used.  Let me illustrate:

I have a form that is sent a long with a number of events to subscribers.

It would have a checkbox next to what is being sent. 

[ ] Enclosed is your {dropdown list with multiple policy names}

[ ] Enclosed is a check for {dropdown for various reasons}

It would be great if I could put a check in the checkbox if the user activates and chooses a value in the associated dropdown list.

So if I use the above example and use the second dropdown because they are sending a refund check it would put the check in the CheckBox10 object once I choose the "policy refund" item from that list (or any item not the default value).

Much appreciate any and all advice.

Thanks for looking,

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile
_Bruce_Robertson
MVP

19-09-2016

Hi,

Assuming you are using a checkbox with the default on/off values of 1 and 0, then this JavaScript code in the calculate event of CheckBox10 should do it;

     DropDownList1.isNull ? 0 : 1;

Just change the DropDownList1 to match the name given to you drop down control.

Regards

Bruce

Answers (3)

Answers (3)

Avatar

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile
_Bruce_Robertson
MVP

22-09-2016

Hi,

Try 'pushing' the value across from the change event of the drop down list, with some code like this JavaScript;

CheckBox10.rawValue = (xfa.event.newText === "") ? 0 : 1;

Assuming your empty value in the drop down is the empty string.

Regards

Bruce

Avatar

Avatar
Validate 1
Level 1
bokenrosie
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
bokenrosie
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
bokenrosie
Level 1

20-09-2016

Wait, my bad.  I copied an element and forgot to rename it.  Works like a charm.  Thanks.

Avatar

Avatar
Validate 1
Level 1
bokenrosie
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
bokenrosie
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
bokenrosie
Level 1

20-09-2016

Hi Bruce,

Thanks for the reply.  I thought it did not work but then realized that it does not change the checkbox until I click into another object.  Is there a way to triger it when they first go to the dropdown?  It is already set on "Commit on Select"  When I change that value to Exit it does not work.  Thanks