Generally Moodle does not work like that. Rather than showing and hiding other elements, we have them always present, but disabled if they are not relevant. See 'disabledIf' in the docs https://docs.moodle.org/dev/lib/formslib.php_Form_Definition
Yes, Thanks !