Code not executed if collapsed

I have a form where a part is collapsed under an “Advanced” button. When initializing the form, I manipulate some values there. This code is not executed on form load (could be by design, maybe it isn´t part of the DOM yet). But when user clicks the Advanced button, it isn´t executed eiter.

Is this the way it is meant to work? How would one solve it?

Hi Giri,
Can you please share a link to your site ?

Roi

I already solved it by putting a copy of the code on the onClick of the Advanced button. Ugly, but it works.