HTML Submit and Reset Buttons

Submit and Reset Buttons in HTML Forms

Every form needs a way to say “I’m done” — that’s the submit button. Sometimes users need a clean slate — enter the reset button. These two controls give users confidence and control over form interaction.

Submit Button: Sending the Form

The <input type="submit"> sends form data to the location defined in the <form action>.

<form action="/submit" method="post">
  <input type="text" name="fruit" placeholder="Apple"><br><br>
  <input type="submit" value="Send">
</form>
[ Apple           ]
[Send]

When clicked, this button sends the form to /submit using the POST method.

Reset Button: Clearing the Form

The <input type="reset"> clears all fields in the form, reverting them to their initial states.

<form>
  <input type="text" name="fruit" placeholder="Banana"><br><br>
  <input type="reset" value="Clear">
</form>
[ Banana           ]
[Clear]

This is especially useful in long forms where users may want to start over.

Using <button> Instead of <input>

You can also create buttons using the <button> element, which allows for more content inside (like icons or HTML).

<form>
  <button type="submit">Submit Form</button>
  <button type="reset">Reset Form</button>
</form>
[Submit Form] [Reset Form]

This is useful when you want styled or labeled buttons that do more than just display text.

Customizing Button Labels

The value attribute lets you change the label of an <input> button.

<input type="submit" value="Send Feedback">
[Send Feedback]

Be clear and action-oriented in your button labels to guide users effectively.

Basic Button Styling with Inline CSS

While CSS deserves a full lesson, here’s a quick peek at customizing button styles inline:

<input type="submit" value="Submit" style="background-color: green; color: white; padding: 8px 16px;">
[Submit]  (green background with white text)

For consistent design, it’s better to move styling to an external stylesheet — but this gives you immediate control.

Full Example: Form with Submit and Reset

<form action="/process" method="post">
  <label for="fruit">Favorite Fruit:</label><br>
  <input type="text" id="fruit" name="fruit" placeholder="Cherry"><br><br>

  <label for="feedback">Your Feedback:</label><br>
  <textarea id="feedback" name="feedback" rows="4" cols="40"></textarea><br><br>

  <input type="submit" value="Send">
  <input type="reset" value="Clear">
</form>
Favorite Fruit:
[ Cherry           ]

Your Feedback:
[                                      ]
[                                      ]
[                                      ]
[                                      ]

[Send] [Clear]

Best Practices

  • Use a reset button only if needed — accidental resets can frustrate users
  • Label submit buttons clearly — “Submit” is okay, “Send Feedback” is better
  • Use the <button> tag when you want flexibility in design or structure

Summary

Submit and reset buttons complete the form experience — empowering users to act, confirm, or rethink. You now know how to:

  • Create submit buttons to trigger form submission
  • Use reset buttons to clear forms
  • Style buttons and label them effectively

Check your understanding 1

Which HTML element is used to submit a form to the server?
Choose one answer. You can try again.

Answer and explanation

<code><input type="submit"></code>

<input type="submit"> is used to submit the entire form data to the server. Alternatively, you can use <button type="submit"> for more control over styling.

Check your understanding 2

The <input type="reset"> button clears all form values to their default states.
Choose one answer. You can try again.

Answer and explanation

True

Yes, clicking a reset button returns form inputs to the values they had when the page first loaded. It's especially useful in editable forms with pre-filled fields.

Check your understanding 3

Choose the option that lists all and only the correct statements.

  1. <input type="submit" value="Submit Form">
  2. <button type="submit">Submit</button>
  3. <submit>Go</submit>
  4. <input type="button" value="Submit">
Which of the following are valid methods to create a submit button in HTML?
Choose one answer. You can try again.

Answer and explanation

Statements 1 and 2

Only the first two options correctly create a submit button. The third is invalid HTML and the fourth creates a button that doesn’t submit the form unless handled by JavaScript.

Check your understanding 4

What does the following HTML code do? <input type="reset" value="Clear Form">
Choose one answer. You can try again.

Answer and explanation

Clears all fields in the form to default values

The reset input clears all current user-entered values and resets them to their default state as specified in the HTML (if any). It does not affect stored data.

Check your understanding 5

You can style a submit button using CSS just like any other element.
Choose one answer. You can try again.

Answer and explanation

True

Yes, submit buttons (both input and button) can be styled using CSS. You can change color, border, padding, hover effects, and more for visual consistency.

Check your understanding 6

Choose the option that lists all and only the correct statements.

  1. <input type="submit" value="Send Feedback">
  2. <button type="reset">Start Over</button>
  3. <button type="file">Upload</button>
  4. <button type="submit" style="background-color: green;">Submit</button>
Which of the following are good examples of using submit and reset buttons in a school feedback form?
Choose one answer. You can try again.

Answer and explanation

Statements 1 and 2 and 4

Options 0, 1, and 3 are valid and meaningful in a school feedback or application form. The third option is invalid because type="file" must be used with <input>, not <button>.

What’s Next?

With form elements in place, the next step is essential: Validating Form Inputs. Learn how to ensure users fill out the right data before they click “Submit.”

Reaching the recap and completing the quizzes are separate milestones.

    Next lesson: HTML Form Validation →