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

Changing an object's presence based on an amount range AND a Pull-Down Selection

Avatar

Avatar
Validate 1
Level 1
Eric_Rosenfeld
Level 1

Likes

0 likes

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
Eric_Rosenfeld
Level 1

Likes

0 likes

Total Posts

25 posts

Correct Reply

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

08-02-2017

Hi,

I have a form that changes various object's presence based on an amount range similar to this:

switch (true)

{

case this.rawValue >= 1 && this.rawValue <= 49999:

Subhead1.presence = "visible";

Subhead2.presence = "hidden";

break;

case this.rawValue >= 50000 && this.rawValue <= 250000:

Subhead1.presence = "hidden";

Subhead2.presence = "visible";

break;

default:

Subhead1.presence = "hidden";

Subhead2.presence = "hidden";

}

As an enhancement, I would like to add a pull-down selection field that changes the amount ranges based on the pull-down selection.

Can anyone offer any advice?

Thanks,

Eric

Accepted Solutions (0)

Answers (1)

Answers (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

11-02-2017

Hi Eric,

Here's one approach, there would be many especially if there is some sort of formula defining the min and max values.  With this approach I am assuming there isn't and the drop down values are Small, Medium and Big,

var ranges

switch (DropDownList1.rawValue)

{

    case "Small":

        ranges = { option1 : {min:0, max:499}, option2 : {min:500, max:2500} };

        break;

    case "Medium": ranges = { option1 : {min:0, max:4999}, option2 : {min:5000, max:25000} };

        break;

    default: ranges = { option1 : {min:0, max:49999}, option2 : {min:50000, max:250000} };

        break;

}

switch (true)

{

    case this.rawValue >= ranges.option1.min && this.rawValue <= ranges.option1.max:

        Subhead1.presence = "visible";

        Subhead2.presence = "hidden";

        break;

    case this.rawValue >= ranges.option2.min && this.rawValue <= ranges.option2.max:

        Subhead1.presence = "hidden";

        Subhead2.presence = "visible";

        break;

    default:

        Subhead1.presence = "hidden";

        Subhead2.presence = "hidden";

}

Regards

Bruce