HTML::...omboBox(3pm)
π HTML::FormFu::Element::ComboBox π
okay bestie, gather round, we're reading the manual page for HTML::FormFu::Element::ComboBox from the User Contributed Perl Documentation. yes it's really called that, no I will not explain the ellipsis, it's just the page header being dramatic π
β¨ NAME β¨
HTML::FormFu::Element::ComboBox β Select / Text hybrid π¦
π VERSION π
version 2.07
πΈ SYNOPSIS πΈ
---
elements:
- type: ComboBox
name: answer
label: 'Select yes or no, or write an alternative:'
values:
- yes
- no
look at that. she's simple. she's clean. she's serving both dropdown AND free text, periodt.
π DESCRIPTION π
So basically it creates a multi element containing a Select field and a Text field. two fields, one vibe, iconic.
A ComboBox element named foo would result in a Select menu named foo_select and a Text field named foo_text. π«Ά And if you're like "hmm, not my names" β no worries, the names can instead be overridden by the name value in select and text. you have options, bestie.
If a value is submitted for the Text field, this will be used in preference to any submitted value for the Select menu. so like, text field wins. she's the main character here. π€
You can access the submitted value by using the ComboBox's name:
my $value = $form->param_value('foo');
boom. that's it. that's the value. β¨
π METHODS π
π« default π«
If the value matches one of the Select menu's options, that options will be selected. Otherwise, the Text field will use the value as its default.
so: matchy-matchy β dropdown handles it. no match β text field takes it. she's flexible fr fr. π
π« options π«
See "options" in HTML::FormFu::Role::Element::Group for details. (iykyk, go read that one, it's right there)
π« values π«
See "values" in HTML::FormFu::Role::Element::Group for details.
π« value_range π«
See "value_range" in HTML::FormFu::Role::Element::Group for details.
π« empty_first π«
See "empty_first" in HTML::FormFu::Role::Element::Group for details.
π« empty_first_label π«
See "empty_first_label" in HTML::FormFu::Role::Element::Group for details.
π« select π«
Arguments: \%setting
Set values effecting the Select menu. Known keys are:
nameβ Override the auto-generated name of the select menu.
π« text π«
Arguments: \%setting
Set values effecting the Text field. Known keys are:
nameβ Override the auto-generated name of the select menu.
bestie I'm just the messenger, that last one is exactly what the page says, word for word. don't come for me. π
β οΈ CAVEATS β οΈ
okay this part matters, listen up π§
Although this element inherits from HTML::FormFu::Element::Block, its behaviour for the methods filter/filters, constraint/constraints, inflator/inflators, validator/validators and transformer/transformers is more like that of a field element, meaning all processors are added directly to the date element, not to its child elements. π«
This element's get_elements and get_all_elements are inherited from HTML::FormFu::Element::Block, and so have the same behaviour. However, it overrides the "get_fields|HTML::FormFu/get_fields" method, such that it returns both itself and its child elements. π
so yeah β she looks like a Block, but she acts like a field in some places. it's giving plot twist.
π₯ SEE ALSO π₯
- Is a sub-class of, and inherits methods from
HTML::FormFu::Element::Multi,HTML::FormFu::Element::Block,HTML::FormFu::Element HTML::FormFu
π AUTHOR π
Carl Franks, cfranks@cpan.org
π LICENSE π
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. π
π AUTHOR π
Carl Franks <cpan@fireartist.com>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2018 by Carl Franks.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
π and that's the whole page bestie, no notes, we ate π
this iconic little manual came to you courtesy of perl v5.28.1, dated 2019-01-12, and it lives under the manual name HTML::...omboBox(3pm) in the User Contributed Perl Documentation. slay, go build a form. π¦β¨π
π¦ where this page comes from
- debian bookworm: libhtml-formfu-perl 2.07000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libhtml-formfu-perl 2.07000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-formfu-perl 2.07000-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms