Using switch statement in a dropdown

usuggestaname

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)

mouslander

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.

usuggestaname

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.