Add required attribute to form elements

Let's implement add support for the "required" attribute, so that form
submission won't occur if some field is missing.
Merge pull request #1811 from mlocati/add-html5-required-attribute

Add required attribute to form elements