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

Using switch statement in a dropdown

Avatar

Avatar
Validate 10
Level 1
usuggestaname
Level 1

Like

1 like

Total Posts

55 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
View profile

Avatar
Validate 10
Level 1
usuggestaname
Level 1

Like

1 like

Total Posts

55 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
View profile
usuggestaname
Level 1

04-03-2015

I am having a problem with using a Switch statement in the change event of a dropdown list. I want the user to select a choice from a dropdown which causes a subform containing just text to become visible. I have used the code below successfully:

var newValue = this.boundItem(xfa.event.newText);

switch (newValue)

{

    case "1":

        auw.presence="visible";

        cdrs.presence="hidden";

        eds.presence="hidden";

        excel.presence="hidden";

        fam.presence="hidden";

        hbcis.presence="hidden";

        emr.presence="hidden";

        mdp.presence="hidden";

        new.presence="hidden";

        oncall.presence="hidden";

        pfm.presence="hidden";

        ppr.presence="hidden";

        queue.presence="hidden";

        tele.presence="hidden";

        phone.presence="hidden";

        win.presence="hidden";

        brain.presence="hidden";

    break;

    case "2"

This seems to work when choosing from up to 7 choices in the dropdown but when I try to include all 17 choices it stops working. Can anyone tell me why this is, and is there anything missing? Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

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

06-03-2015

Just out of curiosity have you tried adding just an 8th. I have run init similar situations where I had a syntax error a a particular spot and things did not work beyond that point.

Avatar

Avatar
Validate 10
Level 1
usuggestaname
Level 1

Like

1 like

Total Posts

55 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
View profile

Avatar
Validate 10
Level 1
usuggestaname
Level 1

Like

1 like

Total Posts

55 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
View profile
usuggestaname
Level 1

08-03-2015

Thanks mouslander - you are a legend. Went back and checked code and found a simple syntax error. It's been driving me crazy - thanks for your help.