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

show/hide subform by select radiobutton

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

06-11-2018

Hi All.

I try to show and show/hide some subforms by click on radiobutton. By default all subforms are hidden. When I click radiobutton the according sunform is appears. But when I selected other radiobutton the other subform is appears also but first subform not disappear. My goal to display only one subform for according radiobutton. That is my code for radiobutton group in change event:

switch (this.rawValue) {

case "1":

subA.presence = "visible";

break;

case "2":

subS.presence = "visible";

break;

case "3":

subP.presence = "visible";

break;

case "4":

subC.presence = "visible";

break;

case "5":

subO.presence = "visible";

break;

case "6":

subW.presence = "visible";

break;

    default:  

subA.presence = "hidden";

subS.presence = "hidden";

subP.presence = "hidden";

subC.presence = "hidden";

subO.presence = "hidden";

subW.presence = "hidden";

    break;

}

To keep subforms hidden when form is open I use that code:

subA.presence = "hidden";

subS.presence = "hidden";

subP.presence = "hidden";

subC.presence = "hidden";

subO.presence = "hidden";

subW.presence = "hidden";

In form1.Page1::docReady - (JavaScript, client).

I would appreciate any corrections/suggestions!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

269 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

06-11-2018

Hi

Try duplicating your docReady code before the case statement, the default branch is executed when no case branch is selected so in your case will be executed when the radiobutton value is not between 1 and 6

Answers (1)

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

07-11-2018

Hi BR001. Thanks for replay.

Thanks for suggestion. Now CASE statement is working.