Validate Forms with Event-Driven Javascript 🛑

Publicado el: 05 diciembre 2020
en el canal de: 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!


En esta página del sitio puede ver el video en línea Validate Forms with Event-Driven Javascript 🛑 de Duración hora minuto segunda en buena calidad , que subió el usuario Rad Devon 05 diciembre 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 210 veces y le gustó 5 a los espectadores. Disfruta viendo!