The "submit" event on forms in JavaScript

114,316
0
Published 2018-07-02
You can use the "submit" event in JavaScript to react to when the user submits an HTML form. This can be useful when you want to use AJAX for your form processing.

In this video I take you through a quick example of how to use the "submit" event - which includes the use of AJAX to submit a form.

Support me on Patreon:
www.patreon.com/dcode - with enough funding I plan to develop a website of some sort with a new developer experience!

For your reference, check this out:
developer.mozilla.org/en-US/docs/Web/Events/submit

Follow me on Twitter @dcode!

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

#dcode #javascript #webdev

All Comments (21)
  • Sometimes you can get stumped by the simplest of issues, and its sooo annoying looking for hours and every tut you watch doesn't seem to give what you KNOW is a simple answer to a simple problem. Your basic method just works! Thanks fella!!! Hope the lockdown isnt driving you nuts lol 👍
  • Thank you very much for this little tutorial. I tried to find a video like this for too long. I wish you good luck, man
  • @nagendra9092
    Thank you, I had a question By taking multiple inputs in FORM like name, age, number, after clicking on submit it will appear on new page with name:xyz, number:123456. with edit option also can we make like this with only using java script. please make a video on this. thank you
  • @Dreku22
    exactly what I was looking for, good stuff
  • @gamenesting5594
    i liked your video, because you deserve this. what your content in this video is the thing i don't find any where in the web
  • @Barnardrab
    How do you get FormData working with just JavaScript? I want to code in Node JS. When I pop the new FormData(myForm) in the parameter of a console.log, I get some obscure data that isn't helpful.
  • thank you so much sir , you know you remove one of my difficulties .
  • @dariuspop3677
    damn the quality of this video! fkn subscribed !!!!
  • @beasta75
    thank you so my bro that worked fine
  • @trytoo5167
    Anyone else getting 405 error method not allowed? How to fix @dcode