I am using radio buttons with a switch statement. Depending on which button you check, a subform will either change it's presence from visible to hidden or vice-versa. This is working great. I am running into problems, however, when I go to Forms->Clear Form when using the form in Acrobat. It clears all data entered, and check-marks, but the visible subforms stay visible. I want them to be hidden again when I clear the form.
I have tried to add in another switch statement as follows:
NewHire.presence = "hidden";
Transfer.presence = "hidden";
Termination.presence = "hidden";
Add.presence = "hidden";
Remove.presence = "hidden";
However, it doesn't seem to be working. Any help? How can I hide the subforms when I clear the form?
When the RadioButtonList is not checked the value is "" not a null so you shoudl be checking for an empty string "". Also which event and which object is the code with the switch statement on? Are you sure that event is firing when you reset the data?
That's definitely helpful. I wasn't sure what the default value was, so I was assuming it was NULL, though I also experiemented with zero.
Let's see, I tried to put the script on the change object, and form:ready object, and layout:ready. I also thought maybe it would be better to go with an if statement, rather than a switch statement since there's only one variation?
If so, I was thinking this:
if (this.rawValue = "")
NewHire.presence = "hidden"
Transfer.presence = "hidden"
Termination.presence = "hidden"
Add.presence = "hidden"
Remove.presence = "hidden"
Now I guess I just need to figure out where to put it? Or do I need to somehow add something else to make it do this?