HTML Forms: Total Domination
Sobre a Aula

The <input type=”reset”> creates a reset button within HTML forms. When clicked by the user, this button performs a crucial action: it restores all the values of the form fields to their default states.

This means that if the user has filled in some fields, changed values, and wants to undo all those modifications, the reset button is the right tool for that.

Imagine filling out an extensive form, realizing you made a mistake, or wanting to start over. The reset button provides a quick and efficient solution.

Illustrating:

<form action="/action_page.php">
  <label for="fname">First name:</label><br>
  <input type="text" id="fname" name="fname" value="John"><br>
  <label for="lname">Last name:</label><br>
  <input type="text" id="lname" name="lname" value="Doe"><br><br>
  <input type="submit" value="Submit">
  <input type="reset" value="Reset">
</form>

When clicked, it nullifies all changes made by the user, restoring each field to the original values set by the developer.

It is crucial to understand that the <input type=”reset”> does not send the form data to the server; it merely restores the visual state of the fields in the user’s browser.

Therefore, it is a valuable tool for enhancing the user experience in situations where correction or data reset is necessary.

By incorporating reset buttons in forms, developers provide users with an easy way to rectify errors or start afresh.

This functionality contributes to the usability of forms, making user interaction more intuitive and effective.

Entrar na conversa
Rolar para cima