Form::...:number(3pm)

πŸ“¦
version 2.5.0 Β· 2 versions
, in ubuntu jammy

πŸ’– Form::...:number(3pm) πŸ’–

okay bestie, gather round, because we're talking about Embperl::Form::Control::number β€” it's a numeric input control with an optional unit, living inside an Embperl Form. yes, a whole module just for "type a number here," and honestly? it ate. πŸŽ€


✨ SYNOPSIS ✨

  {
  type => 'input',
  text => 'blabla',
  name => 'foo',
  unit => 'sec',
  }

like, that's it. that's the whole vibe. a little hashref, a little type, a little name, a lil unit for flavor 🌸


🌈 DESCRIPTION 🌈

so what does this icon do? it creates a numeric input control inside an Embperl Form. that's the main character job. and optionally β€” key word optionally, we love a flexible queen β€” it can display a unit right after the input field. so like, the box where you type the number, and then "sec" or whatever just chilling next to it. iconic.

and if you wanna know how to specify parameters in general? go read Embperl::Form, bestie, it's got the lore. πŸ“–


πŸ¦‹ PARAMETER πŸ¦‹

here's the tea, one param at a time, no skips, no skips allowed:

  • type β€” this one needs to be 'number'. not "num", not "numeric", not "number-adjacent". 'number'. periodt. πŸ’…
  • name β€” specifies the name of the control. that's its whole job and it does it flawlessly.
  • text β€” will be used as the label for the numeric input control. so like, the lil caption that tells everyone what this box is even for. 🏷️
  • size β€” gives the size in characters. (Default: 10) so if you don't say anything, it's a solid ten characters wide. ten out of ten, literally. ✨
  • maxlength β€” gives the maximun length in characters. (yes that's how it's spelled in the source, i'm not fixing her typo, she's perfect as she is 😭) so it caps how much you can type in.
  • unit β€” gives a string that should be displayed right of the input field. like 'sec' in the synopsis up there. very "number goes here β†’ units" energy. πŸ“

πŸ‘‘ Author πŸ‘‘

G. Richter (richter at embperl dot org) β€” thank you for your service, king 🫢


🧚 See Also 🧚

go check these out, they're all connected, iykyk:


πŸ’€ real talk though: don't forget type => 'number' or this whole thing is giving nothing. it needs to be 'number'. that's not a suggestion, that's a requirement, and the module said what it said.

and that's the page, bestie!! 🌟 this one came from the User Contributed Perl Documentation, shipped with perl v5.34.0, dated 2022-02-06. love that for us. mwah πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from