function HOOK_form_alter( &$form, &$form_state, $form_id ){
if( $form_id == "user_register_form" || $form_id == "user_profile_form" ) {
// Shows OTHER text field when 'Other' is selected as their specialty
$form["field_specialty_other"]["#states"] = array(
"visible" => array(
':input[name="field_specialty[und]"]' => array("value"=>"Other"),
)
);
}
}