# How to listen to submit event

**URL:** <https://discourse.mozilla.org/t/how-to-listen-to-submit-event/15475>\
**Category:** Development\
**Created:** [May 8, 2017, 11:16am UTC](https://discourse.mozilla.org/t/how-to-listen-to-submit-event/15475 "2017-05-08T11:16:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user123](https://avatars.discourse-cdn.com/v4/letter/u/ed655f/32.png) [@user123](https://discourse.mozilla.org/u/user123)\
**Post date:** [May 8, 2017, 11:16am UTC](https://discourse.mozilla.org/t/how-to-listen-to-submit-event/15475/1 "2017-05-08T11:16:47Z")

</div>

I am still stuck in this problem that I posted earlier [Can’t listen to submit event](https://discourse.mozilla-community.org/t/cant-listen-to-submit-event/15473). I looked at the events reference in the MDN. I found the submit event in [Submit](https://developer.mozilla.org/en-US/docs/Web/Events/submit). There is something I do not get which says:

> Note that submit is fired only on the form element, not the button or  
> submit input. (Forms are submitted, not buttons.)

My HTML form has the submit as input:  
`<input type="submit" id="submit-button" value="Add">`

And the script file is trying to listen to it. The full codes are posted aleady in [this post](https://discourse.mozilla-community.org/t/cant-listen-to-submit-event/15473)

Can you please clarify the quoted text:

> Note that submit is fired only on the form element, not the button or  
> submit input. (Forms are submitted, not buttons.)

---

<div class="post-metadata">

**Author:** ![NilkasG](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@NilkasG](https://discourse.mozilla.org/u/NilkasG)\
**Post date:** [May 8, 2017, 2:58pm UTC](https://discourse.mozilla.org/t/how-to-listen-to-submit-event/15475/2 "2017-05-08T14:58:07Z")

</div>

As I have answered for your other question, you need to listen for the `submit` event on the `<form>` element, not the input.
