Added support for required attribute in dropdown.

Previously, if the field contained a required attribute, it was ignored
in the generated input.