Form submission on selection

I inserted a code so that if one option is chosen on a radio button it export a function if the other option is chosen it hides the first checkbox else if the other option is chosen it hides the first radioGroup and activates the second radioGroup. The problem is that if the first option is chosen it is not submitted when the submit button is pressed and return to the top of the form. I think my conditions are not right in the code. I would really appreciate any help from the community.
Thank you.
You can see the form at bit. ly / 3co7uJW cliquer sur s’inscrire pour voir le formulaire.

// API Reference: Introduction - Velo API Reference - Wix.com
// “Hello, World!” Example: Velo Learning Center

$w.onReady( function () {

});
export function radioGroup2_click_1(event, $w) {

if ($w( ‘#radioGroup2’ ).value === “communautaire” ) {
$w( ‘#checkboxGroup1’ ).show();
$w( ‘#checkboxGroup1’ ).enable();
}
else
$w( ‘#checkboxGroup1’ ).hide();

console.log($w( ‘#radioGroup2’ ).value);
if ($w( ‘#radioGroup2’ ).value === “investisseur” ) {
$w( ‘#checkboxGroup2’ ).show();
$w( ‘#checkboxGroup2’ ).enable();
}

else
$w( ‘#checkboxGroup2’ ).hide();
}