Hook form alter for Select list/checkbox
I am using profile2 module and trying to disable the editing with the following code:
$form['profile_main']['field_my_textField'][LANGUAGE_NONE]['value']['#disabled'] = TRUE;
This works perfectly for the text field, What about the select list/checkbox field like Gender? It didn't work in the same way.