.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "HTML::Widget::Element::RadioGroup 3pm" .TH HTML::Widget::Element::RadioGroup 3pm "2023-08-10" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" HTML::Widget::Element::RadioGroup \- Radio Element grouping .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 8 \& my $e = $widget\->element( \*(AqRadioGroup\*(Aq, \*(Aqfoo\*(Aq ); \& $e\->comment(\*(Aq(Required)\*(Aq); \& $e\->label(\*(AqFoo\*(Aq); # label for the whole thing \& $e\->values([qw/foo bar gorch/]); \& $e\->labels([qw/Fu Bur Garch/]); # defaults to ucfirst of values \& $e\->comments([qw/funky/]); # defaults to empty \& $e\->value("foo"); # the currently selected value \& $e\->constrain_values(1); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" RadioGroup Element. .PP As of version 1.09, an In constraint is no longer automatically added to RadioGroup elements. Use \*(L"constrain_values\*(R" to provide this functionality. .SH "METHODS" .IX Header "METHODS" .SS "comment" .IX Subsection "comment" Add a comment to this Element. .SS "label" .IX Subsection "label" This label will be placed next to your Element. .SS "legend" .IX Subsection "legend" Because the RadioGroup is placed in a \f(CW\*(C`fieldset\*(C'\fR tag, you can also set a value. Note, however, that if you want the RadioGroup to be styled the same as other elements, the \*(L"label\*(R" setting is recommended. .SS "values" .IX Subsection "values" List of form values for radio checks. Will also be used as labels if not otherwise specified via labels. .SS "checked" .IX Subsection "checked" .SS "value" .IX Subsection "value" Set which radio element will be pre-set to \*(L"checked\*(R". .PP \&\*(L"value\*(R" is provided as an alias for \*(L"checked\*(R". .SS "labels" .IX Subsection "labels" The labels for corresponding \*(L"values\*(R". .SS "constrain_values" .IX Subsection "constrain_values" If true, an In constraint will automatically be added to the widget, using the values from \*(L"values\*(R". .SS "retain_default" .IX Subsection "retain_default" If true, overrides the default behaviour, so that after a field is missing from the form submission, the xml output will contain the default value, rather than be empty. .SS "new" .IX Subsection "new" .SS "prepare" .IX Subsection "prepare" .SS "containerize" .IX Subsection "containerize" .SS "id" .IX Subsection "id" .SH "CSS" .IX Header "CSS" .SS "Horizontal Alignment" .IX Subsection "Horizontal Alignment" To horizontally align the radio buttons with the label, use the following \&\s-1CSS.\s0 .PP .Vb 3 \& .radiogroup > label { \& display: inline; \& } .Ve .SS "Changes in version 1.10" .IX Subsection "Changes in version 1.10" A RadioGroup is now rendered using a \f(CW\*(C`fieldset\*(C'\fR tag, instead of a \f(CW\*(C`label\*(C'\fR tag. This is because the individual radio buttons also use labels, and the W3C xhtml specification forbids nested \f(CW\*(C`label\*(C'\fR tags. .PP To ensure RadioGroup elements are styled similar to other elements, you must change any \s-1CSS\s0 \f(CW\*(C`label\*(C'\fR definitions to also target the RadioGroup's class. This means changing any \f(CW\*(C`label { ... }\*(C'\fR definition to \&\f(CW\*(C`label, .radiogroup_fieldset { ... }\*(C'\fR. If you're using the \f(CW\*(C`simple.css\*(C'\fR example file, testing with firefox shows you'll also need to add \&\f(CW\*(C`margin: 0em;\*(C'\fR to that definition to get the label to line up with other elements. .PP If you find the RadioGroup \f(CW\*(C`fieldset\*(C'\fR picking up styles intended only for other fieldsets, you can either override those styles with your \&\f(CW\*(C`label, .radiogroup_fieldset { ... }\*(C'\fR definition, or you can change your \&\f(CW\*(C`fieldset { ... }\*(C'\fR definition to \f(CW\*(C`.widget_fieldset{ ... }\*(C'\fR to specifically target any Fieldset elements other than the RadioGroup's. .PP Previously, if there were any errors, the label tag was given the classname \f(CW\*(C`labels_with_errors\*(C'\fR. Now, if there's errors, the RadioGroup \&\f(CW\*(C`fieldset\*(C'\fR tag is wrapped in a \f(CW\*(C`span\*(C'\fR tag which is given the classname \&\f(CW\*(C`labels_with_errors\*(C'\fR. To ensure that any \f(CW\*(C`labels_with_errors\*(C'\fR styles are properly displayed around RadioGroups, you must add \f(CW\*(C`display: block;\*(C'\fR to your \f(CW\*(C`.labels_with_errros{ ... }\*(C'\fR definition. .SH "SEE ALSO" .IX Header "SEE ALSO" HTML::Widget::Element .SH "AUTHOR" .IX Header "AUTHOR" Jess Robinson .PP Yuval Kogman .SH "LICENSE" .IX Header "LICENSE" This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.