Occasionally, you need to verify that your form input matches or has certain values. Learn how to go beyond browser validation in this video.
- [Instructor] Let's build the ability…to do some error checking on this form.…So to do that first thing…I'm going to create a variable here…that will track the error in the form if there's any.…So I'm going to need to go ahead and put errorMessage here,…and set that to nothing to begin with.…Go ahead and actually set it to null.…And then, when I set the state of the form…with whatever input field somebody types…what I want to do here is…add…a function…right after this gets done.…
So after this set state gets done…then I'm going to run something else,…and we will check to see…if the state of password one…is not equal to…state of password two.…So if these are not the same…then I'm going to issue a set state…for the error message.…I'll just say passwords do not match here.…
Otherwise then…we'll set the state back to null here.…Okay, that's pretty cool.…We'll save that for now.…And then, what we need to do is…we'll look for this form row section here,…and this is where we want to insert our message.…So here we'll use the ternary operator.…
- Integrating Firebase
- Managing state in forms
- Registering users
- Logging users in and out
- Creating, editing, and deleting records from Firebase
- Filtering and searching data
Skill Level Intermediate
1. Getting Started
2. Routing and Connecting to a Database
3. Registering and Logging In Users
4. Working with Firebase Data
5. Working with Attendees
6. Filtering and Searching
Next steps1m 22s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.