Hello
I have a form with 5 radio buttons. Two of the radio buttons, values 3 and 5 need to make a hidden subform visible. All other values leave the subform hidden. Here is my script:
if (this.rawValue == '1') {
page1.deliveryInformation.flowed.presence = "hidden";
}
if (this.rawValue == '2') {
page1.deliveryInformation.flowed.presence = "hidden";
}
if (this.rawValue == '3') {
page1.deliveryInformation.flowed.presence = "visible";
}
if (this.rawValue == '4') {
page1.deliveryInformation.flowed.presence = "hidden";
}
if (this.rawValue == '5') {
page1.deliveryInformation.flowed.presence = "visible";
}
else {
page1.deliveryInformation.flowed.presence = "hidden";
}
Value 3 is not working. All other values work as expected. I've been looking at this script for over an hour and can't figure out why it isn't working. Any help would be appreciated.
Thanks,
MDawn
Solved! Go to Solution.
Views
Replies
Total Likes
The issue is with the last else part.
Either place the conditions in
if(){
}
elseif(){
}
else{
}
OR
use the switch case as below.
switch (this.rawValue)
{
case "1":
page1.deliveryInformation.flowed.presence = "hidden";
break;
case "2":
page1.deliveryInformation.flowed.presence = "hidden";
break;
case "3":
page1.deliveryInformation.flowed.presence = "visible";
break;
case "4":
page1.deliveryInformation.flowed.presence = "hidden";
break;
case "5":
page1.deliveryInformation.flowed.presence = "visible";
break;
default:
page1.deliveryInformation.flowed.presence = "hidden";
}
Thanks
Srini
Views
Replies
Total Likes
The issue is with the last else part.
Either place the conditions in
if(){
}
elseif(){
}
else{
}
OR
use the switch case as below.
switch (this.rawValue)
{
case "1":
page1.deliveryInformation.flowed.presence = "hidden";
break;
case "2":
page1.deliveryInformation.flowed.presence = "hidden";
break;
case "3":
page1.deliveryInformation.flowed.presence = "visible";
break;
case "4":
page1.deliveryInformation.flowed.presence = "hidden";
break;
case "5":
page1.deliveryInformation.flowed.presence = "visible";
break;
default:
page1.deliveryInformation.flowed.presence = "hidden";
}
Thanks
Srini
Views
Replies
Total Likes
I used the elseif and that worked. Thank you
Margaret Dawn
Views
Replies
Total Likes
Views
Likes
Replies