cannot validate custom field widget for user profile field when editing node I have defined a field widget and set #element_validate to validate the input. This works fine when I create an account, but when I update the account, the field is not validated and does not even save the changes. It is as though the field doesn't exist
I got around it by attaching the validation in hook_form_alter:

function referrer_widget_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    if ($form_id == "user_profile_form") {
        $form["field_who_referred_you"]["#element_validate"] = array('referrer_widget_field_widget_validate');
    }
}