Avatar

Level 4

I have an interactive form where the user applies for a leave of absence and selects one of 6 reasons.

Maternity

Medical

Worker's Comp

Family

Military

Personal

If the user selects Family, there are two sub-reasons:

Serious Illness

Child-related

I've made these two a radio button group and the top-level reasons a separate radio button group. Is there any way to nest one group inside another? I found this .xdp code at http://eslifeline.wordpress.com/2008/05/24/creating-nested-radio-buttons/

form1.#subform[0].Continents.Africa::change - (JavaScript, client)
var asia = xfa.resolveNode("form1.#subform[0].Continents.Asia");
var africa = xfa.resolveNode("form1.#subform[0].Continents.Africa");
var europe = xfa.resolveNode("form1.#subform[0].Continents.Europe");
var kenya = xfa.resolveNode("form1.#subform[0].Continents.Kenya");
var egypt = xfa.resolveNode("form1.#subform[0].Continents.Egypt");
var india = xfa.resolveNode("form1.#subform[0].Continents.India");
var china = xfa.resolveNode("form1.#subform[0].Continents.China");
var other = xfa.resolveNode("form1.#subform[0].Continents.Other");
var explain = xfa.resolveNode("form1.#subform[0].Explain");
asia.y = 89+"points";
europe.y = 119+"points";
other.y = 149+"points";
//asia.x = "1.25in";
//africa.x = "1.25in";
//europe.x = xPosition.value;
kenya.x = childXPosition.value;
egypt.x = childXPosition.value;
kenya.presence = "visible";
egypt.presence = "visible";
kenya.y = 45+"points"
egypt.y = 60+"points";
india.presence = "hidden";
china.presence = "hidden";
explain.presence = "hidden";

I modifed it for my form, like this

**************************hide Child and Illness until Family is clicked
**********doesn't work

var Family= xfa.resolveNode("LOA.Form1.Reason.Family");
var Child = xfa.resolveNode("LOA.Form1.Reason.Child");
var Illness = xfa.resolveNode("LOA.Form1.Reason.Illness");

Child.presence = "hidden";
Illness.presence = "hidden";

Family.y = 0.25+"inches";
Child.y = 0.625+"inches";
Illness.y = 0.625+"inches";
Child.x = childXPosition.value;
Illness.x = childXPosition.value;

Child.y = 5.25+"inches"
Illness.y = 5.0+"inches";


LOA.Form1.Reason.Family::ready:form - (JavaScript, client)

Utilities.resetPositions();

I would greatly appreciate any help or suggestions in making this code function.