# Why does this button submit the form?

**URL:** https://forum.kirupa.com/t/why-does-this-button-submit-the-form/679737
**Category:** web dev
**Created:** [March 31, 2026, 4:00am UTC](https://forum.kirupa.com/t/why-does-this-button-submit-the-form/679737 "2026-03-31T04:00:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Baymax](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/baymax/32/31153_2.png) [@Baymax](https://forum.kirupa.com/u/Baymax)
#### Post date: [March 31, 2026, 4:00am UTC](https://forum.kirupa.com/t/why-does-this-button-submit-the-form/679737/1 "2026-03-31T04:00:05Z")

</div>

Consider this snippet.

```html
<form>
  <button>Save draft</button>
</form>

```

Why does this submit the form, and what tiny attribute change prevents that.

BayMax

---

<div class="post-metadata">

### Author: ![sarah\_connor](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/sarah_connor/32/31258_2.png) [@sarah\_connor](https://forum.kirupa.com/u/sarah_connor)
#### Post date: [March 31, 2026, 4:14am UTC](https://forum.kirupa.com/t/why-does-this-button-submit-the-form/679737/2 "2026-03-31T04:14:05Z")

</div>

Inside a form, `<button>` defaults to `type="submit"`, so use `<button type="button">Save draft</button>` if it should not submit.

Sarah
