NAME

CGI::Test::Form::Group - Records groups of box-type widgets

SYNOPSIS

# $form is a CGI::Test::Form object

use CGI::Test;

my $rgroup = $form->radio_groups;
ok 1, defined $rgroup;

my @title = $rgroup->widgets_in("title");
my ($mister) = grep { $_->value eq "Mr" } @title;
ok 2, $mister->is_checked;

DESCRIPTION

This class is a container for box-type widgets, i.e. radio buttons and checkboxes, which may be groupped by name.

It can be queried to easily retrieve widgets belonging to a group, or to get all the group names.

It is also used internally by CGI::Test to keep track of associated radio buttons, so that checking one automatically unchecks the others in the same group.

INTERFACE

The following features are available:

is_groupname name

Checks whether name is the name of a group.

names

Returns a list of group names, in random order.

widget_count groupname

Returns amount of widgets held in groupname, 0 if none.

widgets_in groupname

Returns a list of all the widgets in the given groupname. If the name is not a valid group name, the list will be empty.

WEBSITE

You can find information about CGI::Test and other related modules at:

http://cgi-test.sourceforge.net

PUBLIC CVS SERVER

CGI::Test now has a publicly accessible CVS server provided by SourceForge (www.sourceforge.net). You can access it by going to:

http://sourceforge.net/cvs/?group_id=89570

AUTHORS

The original author is Raphael Manfredi <Raphael_Manfredi@pobox.com>.

Send bug reports, hints, tips, suggestions to Steven Hilton at <mshiltonj@mshiltonj.com>

SEE ALSO

CGI::Test::Form(3), CGI::Test::Form::Widget::Box(3).