I've created a module which uses hook_form_alter(). When a form is loaded (node/add) I hide a field, and the hook works fine. The problem appears when I do a preview of the form. When the form appears again I see the hidden field (the hook doesn't work). Why?
I hide the field through the line:
$form['field_versio']['und']['0']['value']['#type']="hidden";