5R - Form Elements

Form Element Attribute - novalidate, method, action

The nonvalidate attribute turn off validation for input elements as the form is submitted. You might use it when you want to allow the user to save the form and continue. The method attribute tells the browser how to send the data in your form to the server. The action attribute specifies the URL that will process the information once it is submitted.

Form Elements - fieldset and legend

The fieldset element is used to logically group related fields in HTML. This helps readability. The legend is used to provide a caption for items that are grouped in a fieldset element.

Form Element - label and how to use attributes: for and id

All form elements need a label. The for attribute specifies the id to which the the label should be bound. The id attribute identifies the the HTML element through the DOM. The for of a lable musy match the id of the input in order to link them.

Summary

Using these elements and attributes correctly makes the code more readable for others that may be looking at it. More importantly it helps people using screen readers to know what the input elements are doing in the form.