Validate Forms with Event-Driven Javascript 🛑

Pubblicato il: 05 dicembre 2020
sul canale di: Rad Devon
210
5

🚨🚨🚨 BEFORE YOU JUMP IN 🚨🚨🚨
If you want to work along, you might want to head over to the video's page on my site to get the project starter. https://raddevon.com/articles/validat...

Validating form input on the front-end is a great way to make your users' experience better. When I'm the user, I'd rather know immediately that something is wrong with my input than having to wait until I submit the form and get the results back.

In my previous video, I showed how you can access a form's values which is one piece of the front-end form validation puzzle. This video completes the puzzle.

Here's a link to that previous video on selecting form elements and accessing their values:    • Working with HTML Form Fields in Javascript  

Before I teach you to write Javascript form validation, I'll teach you ways to validate your form without writing custom JS. HTML5 forms have some validation capability baked right in, and using this is preferable to custom validations.

Later, we move on to a scenario where built-in validation either wouldn't work or would be more difficult than the custom variety. We'll start by hooking into an event. This allows us to start running some Javascript when the user interacts with our form. Then, we'll check the user's values to see if they are valid. If they aren't, we'll stop the form from submitting.

Thanks for watching!


In questa pagina del sito puoi guardare il video online Validate Forms with Event-Driven Javascript 🛑 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Rad Devon 05 dicembre 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 210 volte e gli è piaciuto 5 spettatori. Buona visione!