# Why does this button submit the form?

**URL:** https://forum.kirupa.com/t/why-does-this-button-submit-the-form/679885
**Category:** web dev
**Created:** [April 2, 2026, 7:00pm UTC](https://forum.kirupa.com/t/why-does-this-button-submit-the-form/679885 "2026-04-02T19:00:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![BobaMilk](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bobamilk/32/31157_2.png) [@BobaMilk](https://forum.kirupa.com/u/BobaMilk)
#### Post date: [April 2, 2026, 7:00pm UTC](https://forum.kirupa.com/t/why-does-this-button-submit-the-form/679885/1 "2026-04-02T19:00:06Z")

</div>

Consider this snippet.

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

```

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

BobaMilk

---

<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: [April 2, 2026, 7:07pm UTC](https://forum.kirupa.com/t/why-does-this-button-submit-the-form/679885/2 "2026-04-02T19:07:06Z")

</div>

`<button>` inside a form defaults to `type="submit"`, so make it `<button type="button">Save draft</button>` if it should just open a draft action.

BayMax
