Hello,
I have two radio buttons where depending on which button is selected controls which subform is displayed. Its not working. I'd appreciate an extra pair of eyes taking a look at my script to help me see what's wrong. I've gotten this to work before, but this time something's wrong.
Here's the script:
if
(decision.choiceList.rawValue == '1'){
newHire.presence
= "visible";
}
if
(decision.choiceList.rawValue != '1'){
newHire.presence
= "hidden";
}
if
(decision.choiceList.rawValue == '2'){
page2.presence
= "visible";
}
if
(decision.choiceList.rawValue != '2'){
page2.presence
= "hidden";
}
if
(decision.choiceList.rawValue == null){
page2.presence
= "hidden";
}
if
(decision.choiceList.rawValue == null){
newHire.presence
= "hidden";
}
I've checked and rechecked the names of the objects and they appear to be accurate, but still no success.
Thanks,
MDawn
Views
Replies
Total Likes
Hi,
Make sure the form is saved as a Dynamic XML Form in the save-as dialog.
I would use an if/else and try and group conditions. The following is in the client vent of the radio button exclusion group (eg not in the individual buttons):
if (decision.choiceList.rawValue == "1")
{
newHire.presence = "visible";
page2.presence = "hidden";
}
else if (decision.choiceList.rawValue == "2")
{
newHire.presence = "hidden";
page2.presence = "visible";
}
else
{
newHire.presence = "hidden";
page2.presence = "hidden";
}
Also make sure that the radio buttons have specified values, 1 and 2.
Hope that helps,
Niall
Views
Replies
Total Likes
Thanks, Niall. I'll try this. I did remember to save as a Dynamic XML form. I'll try your version of the script.
Thanks,
Margaret Dawn
630-850-1065
Views
Replies
Total Likes
Just to verify, is this JavaScript?
Thanks,
Margaret Dawn
630-850-1065
Views
Replies
Total Likes
Yes Margaret, it is Javascript!
Niall
Sorry to be so dumb. I was getting desperate. And it turned out to be a dumb mistake. I had set the Form Preferences to Dynamic, but neglected to actually save the doc! When I save the doc correctly it now works.
Margaret Dawn
630-850-1065
Views
Replies
Total Likes