input type=radio, radio button group
inputRadio
Radio buttons like these:
The labels ('yes', 'no', 'maybe') for the buttons are automatically equipped with the <label> tag, that's why you may also click on the labels and not just the controls themselves.
<?php
$config = Array(
'type' => 'inputRadio',
'displayname' => 'This is a static radio button collection',
'values' => Array(
0 => 'zero',
1 => 'one',
2 => 'two',
3 => 'more'
),
'value' => '0',
// layout: the container for the entire radio group
'layout' => '%s',
// itemlayout: the layout of a radio row
'itemlayout' => '%radio% %label%\n',
// divider settings: to create multiple columns
'divide' => 5, // default: null
'divider' => '</td><td>', // default: '', see example!
'html' => 'class="inputfieldstyle"',
'help' => 'validation failed for this element',
'rowlayout' => '...%element% %prefix% %postfix% etc...',
'prefix' => 'string to display before element',
'postfix' => 'string to display after element',
'readonly' => 1 | 0,
'display' => 1 | 0
)
);
?>
Live examples:
Validators to use together with this element:
form validation for developers!
clonefish is a proven, mature form generator class that helps PHP developers to create, validate and process secure, flexible and easy-to-maintain formslearn more