Check hidden fields for widget type instead of specific class

See ticket #511 for an explanation.