CGI::T...::Radio(3pm)

πŸ“¦
version 1.111 Β· 2 versions
  • 1.111 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.111 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

CGI::Test::Form::Widget::Box::Radio β€” it's the radio button widget bestie, and yes it's exactly as iconic as it sounds πŸŽ€


✨ SYNOPSIS ✨

okay so here's the vibe, straight up:

# Inherits from CGI::Test::Form::Widget::Box
# $form is a CGI::Test::Form

my @title = $form->radios_named("title");
my ($mister) = grep { $_->value eq "Mr" } @title;
$mister->check if defined $mister;

my $title = $form->radio_by_name("title");
$title->check_tagged("Mr");

no cap, that's the whole thing. grab ur radios, check one, slay πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this class? it represents a radio button widget. and the whole thing with radio buttons is that users can check them at will β€” like, whenever they want, no permission needed, main character energy fr. but here's the tea: the moment one gets checked, all the other radio buttons in the same group get automatically unchecked. periodt. that's just how groups work πŸ’€

now, plot twist: if no radio button is checked initially, CGI::Test will arbitrarily pick the first one listed and hit you with a warn. so like, don't be surprised when that happens, it's just doing its thing πŸ™ˆ

the interface? same one described in CGI::Test::Form::Widget::Box. no new nonsense, we're consistent here ✨

and listen β€” any attempt to "uncheck" a radio button is ignored, and a warning gets emitted via carp to help you find the caller. so like, if ur out here trying to uncheck a radio, the code is literally gonna @ you in the warnings. it's giving "I saw what you did" 😭

fr fr, read the carp warning β€” it's telling you exactly who called it. free debugging, bestie, take the gift 🫢

πŸ‘‘ AUTHORS πŸ‘‘

  • The original author is Raphael Manfredi.
  • Steven Hilton was long time maintainer of this module.
  • Current maintainer is Alexander Tokarev <tokarev@cpan.org>.

three legends, one module πŸ’œ


🌈 SEE ALSO 🌈

go read those too, iykyk πŸ“š


and that's the whole page bestie!! this was perl v5.34.0, dated 2022-06-10, from the User Contributed Perl Documentation πŸ’–βœ¨ thanks for reading, ur officially a radio button expert now, go forth and check things πŸŽ€πŸ’…πŸ¦‹