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.
The details element in forms
From the course: JavaScript: Web Form Programming
The details element in forms
- [Instructor] In some scenarios, your form might have controls that are optional or not critical to the user's task, and you might want to have an option for exposing those controls only if the user wants to see them. And you can make use of the details element for this use case. Now, it's not strictly a form control, but it gives you the ability to hide and show optional content without having to use JavaScript or some other fancy control library. So let's take a look at details_start in, oops, in our live server. All right. So, we're using the same form from the previous output element example, but the difference is that, in this case, we have some additional form controls that are optional to the user's stock trade. So because only a subset of users will want to fill these out, we can provide a way to hide and show them using the details element. So let's go back to the code and implement this. The details element consists of two parts. There's the summary and the content. So…
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
-
-
-
Label and field interaction8m 11s
-
(Locked)
Implementing shortcut key navigation5m 55s
-
(Locked)
Automatic shortcut keys9m 13s
-
Form and field events8m 55s
-
(Locked)
Using the output element5m 10s
-
(Locked)
The details element in forms3m 47s
-
(Locked)
Challenge: Form programming1m 51s
-
(Locked)
Solution: Form programming5m 18s
-
-
-
-
-