CGI::T...t::Box(3pm)
β¨ NAME β¨
CGI::Test::Form::Widget::Box β the abstract representation of a tickable box π
(yes bestie, that's the manual name up top, we're just folding it in so it doesn't look like a robot wrote this π«Ά)
πΈ SYNOPSIS πΈ
# Inherits from CGI::Test::Form::Widget
π DESCRIPTION π
okay so. This class is the abstract representation of a tickable box, meaning a radio button or a checkbox. That's it. That's the whole vibe. π¦
Wanna simulate a user actually clicking that box on or off? Use the check() and uncheck() routines, described down below. Iconic, no cap.
π INTERFACE π
The interface is exactly the same as the one described in CGI::Test::Form::Widget, plus these additions right here π
π Attributes π
groupβ theCGI::Test::Form::Groupobject that holds all the groups of the same widget type.group_listβ the list of widgets that belong to the same group as we do. (our little squad π)is_checkedβ true when the box is checked, i.e. marked with a tick. β
β¨ Attribute Setting β¨
checkβ check the box, by ticking it.check_taggedtag β you can call this on any box, and it'll hunt down the box whose value attribute is tag inside thegroup_list, and then check it. π
If that tag is nowhere to be found, the caller gets a warning via carp. Not a vibe, but okay.
uncheckβ uncheck the box, by removing its ticking mark. β οΈ Heads up though: it is not possible to do this on a radio button β you must check another radio button of the same group instead. That's just the rules, bestie.uncheck_taggedtag β same deal, call it on any box, it finds the box whose value attribute is tag within thegroup_list, and removes its ticking mark. It is not possible to do this on a radio button, as explained inuncheckabove. π
And again: if the specified tag is not found, the caller gets a warning via carp.
π¦ Widget Classification Predicates π¦
There's one extra predicate to tell a checkbox apart from a radio button:
is_radioβ returns true for a radio button. π»is_standaloneβ returns true if the box is the sole member of its group.
Normally only useful for checkboxes: a standalone radio button, although perfectly legal, would always remain in the checked state, and therefore not be especially interesting... π so like, technically valid, practically a snooze.
π§ Miscellaneous Features π§
Although documented, these features are more targeted for internal use... iykyk π
set_is_checkedflag β change the checked status. Radio buttons can only be checked, i.e. the flag must be true: all other radio buttons in the same group are immediately unchecked.
bestie pls β you should use thecheckanduncheckconvenience routines instead of calling this feature directly. π
π AUTHORS π
- The original author is Raphael Manfredi.
- Steven Hilton was long time maintainer of this module.
- Current maintainer is Alexander Tokarev
<tokarev@cpan.org>.
β SEE ALSO β
CGI::Test::Form::Widget(3), CGI::Test::Form::Widget::Box::Radio(3), CGI::Test::Form::Widget::Box::Check(3).
and that's a wrap, angel π«Ά this was perl v5.34.0, dated 2022-06-10, filed under the manual name CGI::T...t::Box(3pm) β go check some boxes, slay, periodt πβ¨
π¦ where this page comes from
- debian bookworm: libcgi-test-perl 1.111-2 Β· Artistic-1.0-Perl
- debian trixie: libcgi-test-perl 1.111-2 Β· Artistic-1.0-Perl
- ubuntu noble: libcgi-test-perl 1.111-2 Β· Artistic-1.0-Perl
- ubuntu resolute: libcgi-test-perl 1.111-2 Β· Artistic-1.0-Perl
- ubuntu stonking: libcgi-test-perl 1.111-2 Β· Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms