JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Radio Buttons

Just like checkboxes, we all know what radio buttons are-they're those round controls that toggle a dot in the middle. You can see radio buttons at work in Figure 16.2, where I'm selecting various options for a new vehicle to buy. In this case, I'm selecting a car and making its color red.

Click To expand
Figure 16.2: The RadioButtons example.

Unlike checkboxes, radio buttons form exclusive groups, where only one radio button can be selected (that is, display a dot in its center) at a time. In Windows forms, radio buttons are grouped automatically by container, but in Web forms, you have to set radio buttons' GroupName property to the same value to associate them into a group. Radio buttons in Web forms are much like radio buttons in Windows forms, but they have the same differences that checkboxes have-you need to set the AutoPostBack property to handle their events when they occur, for example.

Besides standalone radio buttons, Web forms also support radio buttons lists; in fact, the radio buttons at right in Figure 16.2 are in a radio button list control.

Previous Section Next Section

JavaScript Editor Free JavaScript Editor     JavaScript Editor