//very unsure
                //$disabled['id_adh'] = ' disabled="disabled"';
            }
        }
        //second step only: first step, and all the rest
        // flagging required fields for second step
        $second_required = array('montant_cotis' => 1, 'date_debut_cotis' => 1, 'date_fin_cotis' => $contrib->isCotis());
        $required = $required + $second_required;
    }
}
// Validation
$contribution['dyn'] = array();
if (isset($_POST['valid'])) {
    // dynamic fields
    $contribution['dyn'] = $dyn_fields->extractPosted($_POST, $_FILES, array(), $id_adh);
    $dyn_fields_errors = $dyn_fields->getErrors();
    if (count($dyn_fields_errors) > 0) {
        $error_detected = array_merge($error_detected, $dyn_fields_errors);
    }
    // regular fields
    $valid = $contrib->check($_POST, $required, $disabled);
    if ($valid !== true) {
        $error_detected = array_merge($error_detected, $valid);
    }
    if (count($error_detected) == 0) {
        //all goes well, we can proceed
        if ($contrib->isCotis()) {
            // Check that membership fees does not overlap
            $overlap = $contrib->checkOverlap();
            if ($overlap !== true) {
                if ($overlap === false) {