From the course: JavaScript: Web Form Programming
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Challenge: Form validation
From the course: JavaScript: Web Form Programming
Challenge: Form validation
(electronic music) - [Instructor] All right, it's time for another programming challenge. Let's try a challenge using some of what we learned in this chapter. So I'll demonstrate the finished challenge, and then you can spend some time working on your own solution. So here in the browser, I have a simple form with a text area and a file chooser control. Now, the text area has a maximum length constraint applied. So if we go into the code and we scroll down, you can see here that here's my text area, and it has a max length of 100. And what we want to do is give the user a visual indicator that they are approaching the maximum character limit as they're typing. So let's go back to the browser, and you can see that as I'm typing along that when I get within about 50 characters of the limit, the text area turns yellow. So if I keep on typing, then if I get within 20 characters of the limit, the background turns red.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Overview of form validation approaches2m 10s
-
(Locked)
Leveraging basic browser validation3m 21s
-
(Locked)
Implementing better browser validation6m 43s
-
(Locked)
Using CSS to enhance dynamic validation9m 47s
-
(Locked)
Filtering key input9m 57s
-
(Locked)
Using JavaScript for validation7m 3s
-
(Locked)
Challenge: Form validation2m 21s
-
(Locked)
Solution: Form validation3m 53s
-
(Locked)
-