mod_form.php: set element types; use hidden fields

This fixes some debug notices in Moodle 2.5 ;)