Loading
Current section: Form Validation 5 exercises
lesson

Intro to Form Validation

Transcript

00:00 Let's validate some stuff who will validate these forms So when you're all done we will get this nice validation logic when there is no JavaScript or when the JavaScript is slow and Then and that's like built-in browser behavior. And then when we've got JavaScript, we'll have our own custom job or

00:19 rendering for error messages and and stuff and we got to do this all on the server because we can't really trust the user's client all of that stuff and We still want to use the built-in browser capabilities for Validating forms and because it actually is pretty capable. So we've got our input and

00:39 Right here. We say it's required. You also have a max length and you have a pattern even like there are a bunch of Attributes that you have for like built-in browser capabilities and you can even enhance those further with JavaScript As like part of the built-in spec which is pretty cool

00:56 and then as far as the server side aspect of this because the the client side is just for Positive user experience and making things better this progressive enhancement the server side is where you actually get security knowing that you're validating things properly and That is where use action data and your action come into play. So They use action data hook will get access to whatever

01:18 JSON is returned by your action. And so then you can do use that for Showing validation error messages. So that's what we're going to be doing today. And I think you're going to have a great time So let's get going