Empty checkboxes cant be stored

question

(CodderEMR) #1

We cant uncheck everything in General history of demographics and save it correctly, i think this process is not working in latest openemr also. Let me know if any developers has the solution ,In my view the condition in history_save.php is the problem
if (isset($POST["form$field_id"])) {

can anyone help that what is the reason of the above condition


(Stephen Waite) #2

hi @CoderEMR, thanks for the bug report, you’re close, the check boxes present a special condition so you’d need something like

    if (isset($_POST["form_$field_id"])) {
        $newdata[$field_id] = get_layout_form_value($frow);
    } else if ($field_id == 'usertext11') {
        $newdata[$field_id] = get_layout_form_value($frow);
    }