HTML Forms

HTML Forms

form elements
  • The HTML <form> element defines a form that is used to collect user input.
  • Form elements are different types of input elements, like text fields, checkboxes, radio buttons, submit buttons, and more.
  • An HTML form contains form elements.

When to Use GET?

  • The default method when submitting form data is GET.
  • However, when GET is used, the submitted form data will be visible in the page address field.
  • Appends form-data into the URL in name/value pairs.
  • The length of a URL is limited (about 3000 characters).
  • Never use GET to send sensitive data! (will be visible in the URL).
  • Useful for form submissions where a user wants to bookmark the result.
  • GET is better for non-secure data, like query strings in Google.

When to Use POST?

  • Always use POST if the form data contains sensitive or personal information.
  • The POST method does not display the submitted form data in the page address field.
  • POST has no size limitations, and can be used to send large amounts of data.
  • Form submissions with POST cannot be bookmarked.

HTML Forms — Structure map

Clickable & Draggable!

HTML Forms — Related pages: