Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

set multiple drop down list values effect to other form fields

Avatar

Avatar
Validate 10
Level 2
eugzl
Level 2

Likes

5 likes

Total Posts

171 posts

Correct Reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 2
eugzl
Level 2

Likes

5 likes

Total Posts

171 posts

Correct Reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
eugzl
Level 2

01-03-2018

Hi All.

I have drop-down list. And I would like to know if it possible to specify in javascript condition when multiple values from the one list will effect to box of the form. For instance, If values like 2,8,12,25,30 from drop-down box make invisible some other boxes. If it is possible. How it to do?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 10
Level 2
eugzl
Level 2

Likes

5 likes

Total Posts

171 posts

Correct Reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 2
eugzl
Level 2

Likes

5 likes

Total Posts

171 posts

Correct Reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
eugzl
Level 2

04-03-2018

I solved the problem.

var r = dropdown.editValue

var s = r.substring(r.length-6);

switch(s) {

    case '4 week':

          txt1.presence = "invisible";

          txt2.presence = "visible";

          break;

    case '3 week':

          txt1.presence = "visible";

          txt2.presence = "invisible";

          break;

    default:

          txt1.presence = "visible";

          txt2.presence = "visible";

}

Answers (10)

Answers (10)

Avatar

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct Reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct Reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
mouslander
Level 4

04-03-2018

you could do this a few ways. Each selection would trigger an individual set of options. In the sample below, based on what the user selects would change the text in field 1.

If(this.rawValue == "AAA - Week - 4"){

Field1.rawValue = "Some text 1"

}

else

if(this.rawValue == "DDD - Week 2"){

Field1.rawValue = "Some text 2"

}

Else

if(this.rawValue == "CCC - Week - 5"){

Field1.rawValue = "Some text 3"

}

I can create a basic demo for you if you provide your email address.

Avatar

Avatar
Validate 10
Level 2
eugzl
Level 2

Likes

5 likes

Total Posts

171 posts

Correct Reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 2
eugzl
Level 2

Likes

5 likes

Total Posts

171 posts

Correct Reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
eugzl
Level 2

02-03-2018

That is right only for one value (AAA - week - 4). And what if user will select (DDD - week - 4). My purpose create code so that ALL selected values with same (week - number) are working identically.

Thanks.

Avatar

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct Reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct Reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
mouslander
Level 4

02-03-2018

Then all you need to do is to place the command on the exit event of the dropdown list. It would be something like:

If(this.rawValue == "AAA - Week - 4"){

Field1.presence = "visible"

}

Or you could do it dynamically

If(this.rawValue == "AAA - Week - 4"){

Field1.rawValue = "some text"

}

Let me know if you need a sample.

Avatar

Avatar
Validate 10
Level 2
eugzl
Level 2

Likes

5 likes

Total Posts

171 posts

Correct Reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 2
eugzl
Level 2

Likes

5 likes

Total Posts

171 posts

Correct Reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
eugzl
Level 2

02-03-2018

I have drop down list that has list like:

value          text

1          AAA - week - 4

2          BBB - week - 2

3          CCC - week - 2

4          DDD - week - 4

5          EEE - week - 3

6          FFF - week - 2

And I would like when user select, for instance, text "AAA - week - 4" or "DDD - week - 4" another drop down box will invisible. The same situation when user will select values 2 or 3 or 6 the textbox becomes invisible. But actual drop down list has almost one hundred similar values.

Avatar

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct Reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct Reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
mouslander
Level 4

02-03-2018

You want a drop down list that when a selection is made from it, another drop down list will appear based on the selection? if so yes that can be done.

Avatar

Avatar
Validate 10
Level 2
eugzl
Level 2

Likes

5 likes

Total Posts

171 posts

Correct Reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 2
eugzl
Level 2

Likes

5 likes

Total Posts

171 posts

Correct Reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
eugzl
Level 2

02-03-2018

Hi mouslander. Thanks for replay.

I don't need multi selection. My target, if user will make selection some text included "week4" other drop-down box becomes invisible. Is possible to do that?

Thanks.

Avatar

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct Reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 4
mouslander
Level 4

Likes

23 likes

Total Posts

298 posts

Correct Reply

27 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
mouslander
Level 4

02-03-2018

You cannot do this with a drop down as you cannot multi select from a drop down list. You can achieve this with a list box if you check the "Allow Multiple Selection" Check. You have to use something like"

if (ListBox1.rawValue == "1" + "\n" + "2") //I used the "\n" because the selection will add a return. This way I am searching

                                                                 // for the return char.

{

this.rawValue = "1, 2"

}

Avatar

Avatar
Boost 5
Level 2
try67
Level 2

Likes

14 likes

Total Posts

120 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile

Avatar
Boost 5
Level 2
try67
Level 2

Likes

14 likes

Total Posts

120 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile
try67
Level 2

02-03-2018

[Question moved to the LiveCycle Designer forum]

Avatar

Avatar
Validate 10
Level 2
eugzl
Level 2

Likes

5 likes

Total Posts

171 posts

Correct Reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 2
eugzl
Level 2

Likes

5 likes

Total Posts

171 posts

Correct Reply

5 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
eugzl
Level 2

01-03-2018

Hi Thom Parker. Thank for replay.

I'm using LiveCycle or AEM Designer Form application. Let me rephrase my question. I want create condition on DropDown1 box selection. In my DropDown1 box has such value:

value          text

-----------------------------------

1              AAA - week4

2              BBB - week2

3              CCC - week4

4              DDD - week3

5              EEE - week2

I would like similar like this:

If (DropDown1.value == "1", "3") {

    DropDown2.presence  = "invisible";

}

else {

    DropDown2.presence  = "visible";

}

How to specify condition with some values on one drop-down box selection. If that is possible. What is correct code?

Thanks.

Avatar

Avatar
Boost 5
Level 3
Thom_Parker
Level 3

Likes

5 likes

Total Posts

90 posts

Correct Reply

2 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Boost 5
Level 3
Thom_Parker
Level 3

Likes

5 likes

Total Posts

90 posts

Correct Reply

2 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 1
View profile
Thom_Parker
Level 3

01-03-2018

Yes, you'll find part of your answer in this article:

https://acrobatusers.com/tutorials/change_another_field

The article presents a technique for setting the value of other fields from a dropdown. But you can use this same technique to show/hide other fields using the "field.hidden" property.