HTML::...Fields(3pm)

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

πŸ¦‹ HTML::FormFu::Constraint::MinMaxFields β€” the manual, but make it make sense

okay bestie, you found the perl docs for HTML::FormFu::Constraint::MinMaxFields, which lives in the User Contributed Perl Documentation section of the manual (that's the (3pm) situation, iykyk). It's a Min/Max Multi-field Constraint, and honestly? it's giving "count your friends and make sure you have enough but not too many." Let's go. πŸ’…


✨ VERSION ✨

version 2.07 β€” yes, that's the one, no cap.


✨ SYNOPSIS ✨

type: MinMaxFields
name: foo
others: [bar, baz]
min: 1
max: 1

that's the whole vibe right there. foo is your main character, bar and baz are the supporting cast, and you're telling the form "hey, between 1 and 1 of these should actually be filled in." periodt. πŸŽ€


✨ DESCRIPTION ✨

So what does this thing actually do? It makes sure that at least a minimum number of fields are present, and only a maximum number of fields are present. Like a bouncer for your form. πŸ’ͺ

⚠️ important lore: this constraint doesn't honour the not() value. So if you were hoping to flip it, uh, no. It said no. πŸ™ˆ

✨ METHODS ✨

minimum / min 🌸

The minimum number of named fields which must be filled in.

min is an alias for minimum. two names, one job, we love an efficient icon. πŸ‘‘

maximum / max πŸ”₯

The maximum number of named fields which must be filled in.

max is an alias for maximum.

And the default for max? It's the number of all affected fields β€” in other words, one more than the number of elements given to others. so if you don't set it, it's basically like "sure babe, all of them, go off." ✨

attach_errors_to_base πŸ’–

Default Value: 1

attach_errors_to_others 🫢

Default Value: 0


✨ SEE ALSO ✨

This bad boy is a sub-class of, and inherits methods from:

  • HTML::FormFu::Role::Constraint::Others
  • HTML::FormFu::Constraint

Also peep HTML::FormFu while you're at it, bestie.


✨ AUTHOR ✨

Mario Minati "mario.minati@googlemail.com" β€” legend behaviour. 🌟


✨ LICENSE ✨

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself. (slay, open source rights πŸ’œ)


✨ AUTHOR ✨ (yes, again β€” it's in the original, don't come for me 😭)

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!! πŸŽ€βœ¨ this little doc came to you courtesy of perl v5.28.1, dated 2019-01-12, and it's filed under HTML::...Fields(3pm) in the manual. go forth and validate those multi-field forms, you absolute icon. πŸ‘‘πŸ’–

πŸ“¦ where this page comes from