We need to declare the $readonly and $disabled here, otherwise you get Notice: Undefined variable: notices from line 1022 and 1023.