Current section: Inputs 59 exercises
Problem

Radios

Loading exercise

Transcript

00:00 Radio buttons are actually pretty similar to selects, where you have multiple options, only one value. Here we have multiple options, only one value. And it's also in some way similar to checkboxes, where the checked property is how you determine whether one of these inputs

00:18 is checked. So the situations where you would use a select over a radio group is that maybe there are a lot of different options. It just looks funny. But the ultimate result is going to be

00:33 the same, whether you're using select or checkbox or radio buttons. You can dive into the MDM web docs to learn more about this. One thing I thought was kind of interesting is how the radio buttons actually come from these radio buttons, where you push one in, and then you can push another one in, and that will pop the other one out. So you can only have

00:54 one of them selected at a time. And so, yeah, that's, if you never knew, that's where it comes from. It's actually from old-fashioned push-button radios, which is kind of fun. So your job is to add this radio group. The challenge here is that we've got actually multiple different kinds of

01:12 labels, whereas with a select, you have the label for the select, and then you have options, and each of those options has children, which is the label for that option. Here, you have a label for the whole group, and then you have labels individually for each one of these inputs.

01:30 And so you have to kind of have a different type of label to make this work in a good way. So you're going to be using a field set for that, which will be fun, and a legend. So have a good time with this. We'll see you when you're done.