combine tows hide fields

combine two hide fields

if ({id_type_produit} == ‘7’)
{
sc_field_display({mdp_google}, on);
sc_field_display({adresse_google}, on);
}
else
{
sc_field_display({mdp_google}, off);
sc_field_display({adresse_google}, off);
};

if ({id_type_produit} == ‘8’)
{
sc_field_display({mdp_google}, on);
sc_field_display({adresse_google}, on);
sc_field_display({operateur}, on);
}
else
{
sc_field_display({operateur}, off);
sc_field_display({mdp_google}, off);
sc_field_display({adresse_google}, off);
};

Field 2 is visible and not visible but not the field 1 how to make the fields appear according to the choice

What about

if ({id_type_produit} == ‘7’)
{
sc_field_display({mdp_google}, on);
sc_field_display({adresse_google}, on);?
sc_field_display({operateur}, off);

}
elseif ({id_type_produit} == ‘8’)
{
sc_field_display({mdp_google}, on);
sc_field_display({adresse_google}, on);
sc_field_display({operateur}, on);

}
else
{
sc_field_display({operateur}, off);
sc_field_display({mdp_google}, off);
sc_field_display({adresse_google}, off);

}

Thanks for the code everything works