HTML::Widget::Plugin::Radio - a widget for sets of radio buttons
version 0.203
$widget_factory->radio({ name => 'radio', value => 'value_1', options => [ [ value_1 => "Description 1" ], [ value_2 => "Description 2" ], [ value_2 => "Description 2", 'optional-elem-id' ], ], });
This will emit roughly:
<input type='radio' name='radio' value='value_1' id='radio-value_1' checked='checked'></input> <label for='radio-value_1'>Description 2</label> <input type='radio' name='radio' value='value_2' id='radio-value_2'></input> <label for='radio-value_2'>Description 2</label> <input type='radio' name='radio' value='value_3' id='optional-elem-id'></input> <label for='optional-elem-id'>Description 2</label>
This plugin provides a radio button-set widget
provided_widgets
This plugin provides the following widgets: radio
radio
This method returns a set of radio buttons.
In addition to the generic HTML::Widget::Plugin attributes, the following are valid arguments:
If true, this option indicates that the select widget can't be changed by the user.
If this is given and true, an invalid value is ignored instead of throwing an exception.
This option must be a reference to an array of allowed values, each of which will get its own radio button.
If this argument is given, the option with this value will be pre-selected in the widget's initial state.
An exception will be thrown if more or less than one of the provided options has this value.
validate_value
This method checks whether the given value option is valid. See "radio" for an explanation of its default rules.
"radio"
Ricardo SIGNES
This software is copyright (c) 2005 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install HTML::Widget::Factory, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::Widget::Factory
CPAN shell
perl -MCPAN -e shell install HTML::Widget::Factory
For more information on module installation, please visit the detailed CPAN module installation guide.