What does size attribute of number field type do? #440
-
When I go to create a number field type in the craft cp, there is a 'size' field. What does this do? The docs say no more than "Size – The input’s size attribute." So what does this do? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Sorry for any confusion. This may just be a legacy feature that has persisted, but I think it makes some sense… here's a few tidbits that may clarify what's going on: Generalizations About Inputs
Input TypeThe "Number" field is still rendered as an <input
type="text"
id="fields-rating"
class="text"
name="fields[rating][value]"
size="42"
inputmode="numeric"
autocomplete="off"
dir="ltr"> ☝️ Note the Size AttributeThis is added—and does indeed work—because the generated HTML uses the Hope this helps! |
Beta Was this translation helpful? Give feedback.
Sorry for any confusion. This may just be a legacy feature that has persisted, but I think it makes some sense… here's a few tidbits that may clarify what's going on:
Generalizations About Inputs
Input Type
The "Number" field is still rendered as an
<input type="text">
element, in the Craft control panel: