form_radios($title, $name, $value, $options, $description = NULL, $required = FALSE, $attributes = NULL)
drupal-4-6/includes/common.inc, line 1123
Format a set of radio buttons.
$title The label for the radio buttons as a group.
$name The internal name used to refer to the buttons.
$value The currently selected radio button's key.
$options An associative array of buttons to display. The keys in this array are button values, while the values are the labels to display for each button.
$description Explanatory text to display after the form item.
$required Whether the user must select a radio button before submitting the form.
$attributes An associative array of HTML attributes to add to each button.
A themed HTML string representing the radio button set.
function form_radios($title, $name, $value, $options, $description = NULL, $required = FALSE, $attributes = NULL) {
if (count($options) > 0) {
$choices = '';
foreach ($options as $key => $choice) {
$choices .= '<label class="option"><input type="radio" class="form-radio" name="edit['. $name .']" value="'. check_plain($key) .'"'. ($key == $value ? ' checked="checked"' : ''). drupal_attributes($attributes) .' /> '. $choice .'</label><br />';
}
return theme('form_element', $title, $choices, $description, NULL, $required, _form_get_error($name));
}
}