HTML::...omboBox(3pm)

πŸ“¦
version 2.07000 Β· 5 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– 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>

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