Hello, in this jQuery video we are going to detect the form submit event. So this event is triggered when the user submits a form basically. So let's simply create a quick form. I'm going to have an empty action. The action is have an input type text. Obviously, we're just creating some really, really simple form this return to the actual submission.
And that's a form for a placeholder just make it look nice. For the placeholder and to use. Know I'm gonna have worn more than that. But this time, it's gonna be quite Submit. and the value is. So you can log in with just a username and password before reload.
And if I click this, you know, it does this reload. If we want to actually detect when this is actually being triggered. We can go here. First of all, we need to actually pick this form. You can either assign an idea class three was picking directly within form. However, once a form, for example, do dot submit and now I'm just gonna do an JavaScript alert, same form.
So if I reload that now, and DOMA was in here, and I click login, as you can see, say form has been submitted. So in this case, because we have an action, it actually reloads the page or let me try and go to another page. That's the reason I did an alert instead of a console a lot. But this is how you detect when a form has been submitted. You could actually prevent the default behavior as well. I've got a video on that, so I highly recommend checking that out.
That's it for this tutorial. If you have any questions, feel free to pop me a message. And as usual, I look forward to seeing you in the next video.