Kanbritech Learn logo
HTML HTML Forms 45h track

HTML Form Attributes

Write the opening form tag for a POST upload to /uploads.

Understand the topic

The form action chooses a destination, method chooses the submission method, and enctype controls encoding. GET places values in the URL and suits searches; POST sends values in a request body and suits many changes. Neither method provides encryption: HTTPS does. File uploads use multipart/form-data. autocomplete helps the browser fill appropriate values.

Worked example

<form action="/search" method="get">
  <label for="query">Search courses</label>
  <input id="query" name="q" type="search">
  <button type="submit">Search</button>
</form>

Submitting HTML produces a URL containing q=HTML. This is a source example: /search must be implemented by your server before using it as a working endpoint.

Practice

Write the opening form tag for a POST upload to /uploads.

Show a suggested answer
<form action="/uploads" method="post" enctype="multipart/form-data">

Common mistake

Do not place secrets in GET parameters. They can appear in history and logs. POST still requires HTTPS and server validation.

HTML documentation

Try Coding

Result