Adding the onsubmit handler

Now you've created your rules, you need to attach them to the form so that when the user submits the form, the RSV library validates the form with your rules. This is very easy, just add an onsubmit attribute to your form tag, like so:

<form ... onsubmit="return rsv.validate(this, rules)">

And you're done! Now continue to the next step to see the final result.

Edit Page