From the course: JavaScript: Web Form Programming
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Using CSS to enhance dynamic validation
From the course: JavaScript: Web Form Programming
Using CSS to enhance dynamic validation
- [Instructor] In addition to specifying various input constraints, to help the user enter valid data, there are some CSS features that you can use to visually indicate to the user that form fields are required or invalid, or contain valid information. Let's go ahead and open up the CSS validation start file. And we're going to continue using the Stock Purchase example to demonstrate these CSS features. All right, let's go ahead and bring this up in the browser. So, first let's see how we can apply a style to a required input field. So CSS gives us a pseudo class that we can apply to required elements. So let's indicate that a field is required by giving it a thick, blue, left border. So let's go back to the code, and inside my style section here, I'm going to define a style rule for input, and then I'm going to use the required pseudo class. And I'll specify that border left, right? Should be a .3em solid blue. All…
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)
-