Another dropdown issue. I have selection choice result canceling themselves out?
Is there a way to avoid this?
DD1 is the dropdown menu
TF(*) are just text fields
If(DD1.rawValue == "1")
{
TF1.presence = "visible"; TF2.presence = "visible"; TF3.presence = "visible";
}
else
{
TF1.presence = "hidden"; TF2.presence = "hidden"; TF3.presence = "hidden";
}
If(DD1.rawValue == "2")
{
TF2.presence = "visible"; TF3.presence = "visible"; TF4.presence = "visible";
}
else
{
TF2.presence = "hidden"; TF3.presence = "hidden"; TF4.presence = "hidden";
}
When I select "1" only TF1 shows
when I select "2" TF2, TF3, and TF4
For selection "1" TF2 and TF3 is being cancelled out? If so, then in selection "2", shouldn't only TF4 show up?
If there a solution here?
Thank you advance
Solved! Go to Solution.
Views
Replies
Total Likes
When I have done this type of thing I have found else scripts a little unreliable. The thing is, in this case it isnt needed at all, just put everything in the if statement. Hide and show objects in one place. It will work this way.
Eg
If(DD1.rawValue == "1") //when 1 is selected, show TF1, 2 and 3 but not 4
{
TF1.presence = "visible";
TF2.presence = "visible";
TF3.presence = "visible";
TF4.presence = "hidden";
}
If(DD1.rawValue == "2") //when 2 is selected, show TF2, 3 and 4 but not 1
{
TF1.presence = "hidden";
TF2.presence = "visible";
TF3.presence = "visible";
TF4.presence = "visible";
}
Views
Replies
Total Likes
When I have done this type of thing I have found else scripts a little unreliable. The thing is, in this case it isnt needed at all, just put everything in the if statement. Hide and show objects in one place. It will work this way.
Eg
If(DD1.rawValue == "1") //when 1 is selected, show TF1, 2 and 3 but not 4
{
TF1.presence = "visible";
TF2.presence = "visible";
TF3.presence = "visible";
TF4.presence = "hidden";
}
If(DD1.rawValue == "2") //when 2 is selected, show TF2, 3 and 4 but not 1
{
TF1.presence = "hidden";
TF2.presence = "visible";
TF3.presence = "visible";
TF4.presence = "visible";
}
Views
Replies
Total Likes
Again Brilliant! This works for me!
Thank you!
Views
Replies
Total Likes
Glad to assist.
Views
Replies
Total Likes