From the course: Full Stack Web Development with Flask

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Displaying form validation error messages

Displaying form validation error messages - Flask Tutorial

From the course: Full Stack Web Development with Flask

Displaying form validation error messages

- Displaying form validation error messages. In this video we're going to take a look at validating form data, showing inline error messages for form fields, and styling and formatting error messages, so let's go back to the code and see how these are done. Okay, the last thing we want to do for this part is the error messages so when we log into the form in here, like in here, we also want to put some errors, and you do that by things like maybe if you didn't have enough character size or if it's empty, because you put it, you could validate it, so we probably won't see it, but up here if we say novalidate, okay, and then here we're going to put an error message in here and we do that by issuing a form error, so we can check for the error. That means we can go here and put a function here, and say if, and that function with if block, and say if there are form.email has errors, again, that is true, then we need to output…

Contents