Form Elements

Form Element Attribute - novalidate, method, action

  1. The novalidate attribute means the form will not get validated when submit it, for example, enabling this attribute will let users save the form and continue/submit it later
  2. The form method tells the browser how to send form data to a web server. There are two values: GET and POST. GET makes the result visible in URL while POST will send the data to the web sever to be processed.
  3. The action attribute specifies where the form data will be sent after the submission. Usually the data goes to the server.

Form Elements - fieldset and legend

  1. The fieldset is used to group related elements in the form and it also created the box over them.
  2. The legend tag creates a caption for the fieldset.

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

  1. The label tag defines a text label for the input tag. To associate label element with input we need to add id attribute to the input and for attribute to the label.
  2. The value of for attribute to the label element is the same as id in the input element. If you put input directly inside the label, the for and id attributes are not needed. The value for the for attribute matches the id attribute.

Summary of the documentation

In conclusion, form element is used to collect user input. The form element is a container for different types of input elements such as textfields, checkboxes, buttons etc.