sets type in form element