Expand and shrink Acordion based on Toggle

Hi
I would like the Accordion to expand and shrink based on Toggle control selection

The below code is not working

fd.spRendered(function() {

function enableOrDisableResolvedSection() {
    if (fd.field('DirectAward').value) {
	 alert("yes");
        // Show the tab number 1, in our case Resolved
        fd.container('Accordion1').$children[0].disabled = false;
    } else {
        // Hide the tab number 1, in our case Resolved
        fd.container('Accordion1').$children[0].disabled = true;
    }
}

// Calling enableOrDisableResolvedSection when the user changes the Status
fd.field('DirectAward').$on('change',enableOrDisableResolvedSection);

// Calling enableOrDisableResolvedSection on form loading
enableOrDisableResolvedSection();

});

I tried using fd.container('Accordion1').$children[1].disabled and
fd.container('Accordion1').$children[0].disabled

Both throws error
Uncaught ReferenceError: Type is not defined
at :2:206
at p (jquery.min.js:2)
at Function.globalEval (jquery.min.js:2)
at text script (jquery.min.js:4)
at Qb (jquery.min.js:4)
at A (jquery.min.js:4)
at XMLHttpRequest. (jquery.min.js:4)

for some reason when I change the name from Accordion1 to client1 it worked.

1 Like

I concur - until I gave my Toggle buttons custom names, they did not behave.