Signup forms can use four input types for most fields: text, number, tel and time. Each type tells the browser what to accept before the form is submitted. Reference examples show the key limits: minlength and maxlength for text, min and max for number, and a numeric keypad without spinner arrows for tel. HTML5 can enforce most of these rules without a custom script.
Everyday takeaways
- Add a prefix or suffix where the unit matters, so the visitor sees the unit beside the box. Affix guidance explains why this helps.
- Write descriptive labels for every field. Labelling guidance says labels should help people identify components, so each label should name its question.
- Choose the input type that matches the data a visitor will type, not the one that looks most familiar.
- Put limits in the markup so the browser catches most bad entries before your team writes any script.
Why HTML5 checks can run before a script
HTML5 gives form fields a validation layer that runs in the browser, and MDN's guide to form validation makes the point in a single sentence. In English, MDN's guide states that one of the features of HTML5 is the ability to validate most user data without depending on scripts (MDN Web Docs, Form data validation).
For a signup team, this matters because the rules live with the field itself. When you set a limit on an input, the limit travels with the markup. The browser can stop a submission and show a message without a custom check written for each field.
A visitor who enters a value outside an allowed number range gets feedback at the moment of the mistake. That immediacy is worth more than it looks. Some signup errors are honest slips: a stray character, a value entered in the wrong box, a field left in the wrong state. Catching those in the browser means fewer rejected submissions and fewer confused visitors. It also spares your support team from explaining a message the visitor could have fixed on the spot.
The browser check is a first filter, not the only one. Anyone can send a request to your server without loading your page, so the rules that protect your data still need a server-side check. What the browser check does well is catch honest typing errors. It costs your team no extra code beyond the attributes on the field, which makes it a sensible default for a signup form that changes often. Treat the markup as the first line of defence, and keep your server rules in step with it so the two never disagree.
The four input types side by side
Four input types cover most signup questions. Text suits names and free entries, number suits quantities that move in steps, tel suits phone numbers and long codes, and time suits a clock value. They differ in which limits the browser can enforce, and the MDN pages name a different set of attributes for each one. The table lines up the matching example from each page so you can compare them on the same measures.
| Input type | Limit named in MDN | Example from MDN | What the visitor sees |
|---|---|---|---|
| text | minlength and maxlength | 6 characters, the same length as "banana" and "cherry" | The field carries a minimum and maximum length of 6 |
| number | min and max | 1 to 10 | Values outside the range show as invalid, and spinner arrows stop at the limit |
| tel | Suited to long codes where incremental steps make no sense | USA ZIP codes from 00001 to 99999 | A numeric keypad, with no spinner arrows |
| time | Several accepted forms of one moment | 23:59 | One moment written in a clock format |
These figures are the ones MDN picked to illustrate each type. They are not recommendations for your form, so the right limit depends on the data your team needs to collect.
Read across a row and a pattern appears. Text and number carry bounds the browser checks directly, either a length or a numeric range. Tel and time depend more on the shape of the data than on a range. That difference should shape how much you rely on each type's built-in checking and how much testing you do yourself. The time row also shows something useful: MDN expresses one moment in more than one way, so a time field should be read as a format rule rather than a single fixed string.
Text fields: setting minimum and maximum length
A text field is the broadest type, so its limits are about length rather than value. In MDN's example, the text field receives a minlength and a maxlength of 6, the same length as the words banana and cherry. The example is deliberately small. It shows that both bounds sit on the same field, and that an entry must fall between them to pass.
For a signup form, length settings answer practical questions, such as how many characters a username can hold or how short a company name may be. The browser enforces the numbers you write, so each number becomes a rule that visitors meet directly. A limit set too tight will reject genuine entries, and a limit set too loose lets junk through. Neither mistake shows up in the markup itself.
That is why it helps to test the field before launch. Collect a set of real names from past sign-ups, including unusual ones, and see which fail. Try a few entries that are deliberately too short and too long, and watch what the visitor sees. A length rule that passes the easy cases can still fail the awkward ones.
Use the same discipline for every text field on the form. Give each one a length that matches the information it holds, and check the labels so the visitor knows what belongs in the box. A short, clear length rule paired with a descriptive label lowers the number of entries that fail, because the visitor understands the request before typing.
Number fields: range limits and default values
A number field carries two settings that matter most for signup: a lower and an upper bound. The number example in the same guide gives the field a min of 1 and a max of 10. Numbers entered outside that range show as invalid, and the spinner arrows cannot move the value past either limit. The spinner arrows stop at either limit, while a typed out-of-range value is only marked invalid.
MDN also shows how to start a number field with a value already filled in. Its example sets a default value of 250000 using the value attribute (MDN Web Docs, The HTML5 input types). A default helps when most visitors choose the same figure, but it also means the visitor must notice and change it if the figure is wrong for them.
A default is a choice made on the visitor's behalf. Before you set one, ask two questions. Would most visitors accept it without thinking? And if they missed a wrong figure, would it cost them anything? If the answer to either is uncertain, leave the field empty and let the label do the work.
| Setting | Value in MDN example | Effect for the visitor |
|---|---|---|
| min | 1 | Values below 1 show as invalid |
| max | 10 | Values above 10 show as invalid, and the spinner cannot go past it |
| default value | 250000 | A separate example on the input types page starts the field at 250000 until the visitor changes it |
Number fields suit quantities that people move up and down in steps. Before you set a range, confirm that the bounds match the real question. A range that is too narrow blocks valid answers, and a range that is too wide gives the spinner arrows little meaning.
Tel fields: when the numeric keypad helps
The tel type is the right choice when a number is not really a quantity. MDN notes that if the range is too large for incremental increases to make sense, the tel type might be a better option, because it provides the numeric keypad while dropping the spinner interface. The example MDN gives is a USA ZIP code, which runs from 00001 to 99999. Stepping up or down through that range would be meaningless, so the spinner adds nothing.
The comparison below sets the two types side by side on the same three measures.
| Measure | number | tel |
|---|---|---|
| Best fit | Short ranges, such as 1 to 10, where steps make sense | Long codes, such as 00001 to 99999 |
| Spinner arrows | Provided | Not provided |
| Numeric keypad | Not named in this MDN note | Provided |
The practical choice follows from the data. If the visitor is picking a count or a rating, number gives them steps and bounds. If the visitor is typing a code or a phone number, tel gives them the keypad without arrows that cannot help.
There is a cost to getting this wrong. A spinner on a phone field invites the visitor to step through digits that have no order, which looks careless and wastes their time. A keypad with no spinner keeps the visitor focused on typing the number they actually have.
Keep one limit in mind. Tel gives the keypad, not a guarantee that a phone number is valid. Any format check for a particular country still needs a pattern or a server-side rule. The type helps the visitor enter the right kind of characters, and your own rules decide whether those characters form a real number.
Time fields: accepted formats for one moment
A time field records a moment, and one moment can be written in several ways. The input types guide gives a concrete example: "The last minute of the previous millennium can be expressed in the following different ways: 1999/12/31, 23:59, or 12/31/99T11:59PM". The same moment appears in three shapes, and each one carries a different part of the information.
| Written form | Parts it carries | Format notes |
|---|---|---|
| 1999/12/31 | Date only | No clock value |
| 23:59 | Clock value only | No date |
| 12/31/99T11:59PM | Date and clock value | Clock value ends with PM |
The table shows why a time field needs a format decision before launch. A visitor asked for a preferred call time might type a clock value, a full date and time, or something in between. Your form has to decide which shape it accepts, then say so in the label. The guide's example illustrates how a moment can be written. It does not list the forms your system must accept, so treat the three examples as a teaching set, not a complete list.
Choose one format for your team, state it plainly beside the field, and confirm that your back end reads the stored value the same way. If the field records a moment that matters across time zones, add that to the label too, because the same clock reading can point to different moments for different visitors.
Prefix and suffix labels for units
Some fields are easy to misread without a unit. A box that asks for a number could be a count, a weight, a price or a share of something, and the visitor has to guess which. The U.S. Web Design System explains why this pattern helps: "Adding a prefix or suffix can help the user more quickly understand what kind of information is requested" (Digital, Input prefix/suffix). A prefix sits before the entry area and a suffix sits after it, so the unit appears beside the place where the visitor types.
Signup forms gain the most from this on number and tel fields, where the same digits can mean different things. The default value of 250000 in MDN's number example shows the problem. A bare figure like that could stand for a salary, a budget or a headcount, depending on the question. A suffix that names the unit answers the question before the visitor starts typing.
Currency symbols deserve the same care. A prefix should match the currency your system actually charges in, or the visitor will read the amount in the wrong money. Check the affix against your billing rules before launch, not after the first complaint.
Two cautions keep an affix useful. First, a prefix or suffix supports the label rather than replacing it. The label still names the question, and the affix shows the unit. Second, keep the affix short. The guidance is about understanding the request, so a long phrase beside the field works against that goal. Use an affix only where the unit is unclear from the label. A unit the label already states plainly does not need repeating, and repeating it adds clutter without adding information.
Descriptive labels for every field
A label is the text a visitor reads before typing anything. The success criterion on headings and labels puts the goal in one line: "Descriptive labels help users identify specific components within the content" (World Wide Web Consortium, Understanding Success Criterion 2.4.6). The test that follows is simple. Could a visitor tell which component a label belongs to, and what it wants them to enter?
Apply that test to a signup form. A label reading "Number" beside a box says nothing about whether the box wants a team size, a postcode or a budget. "Team size (people)" names the component and the unit together. Generic words such as "Details" or "Info" fail the test, because they could apply to almost any field on the page.
The same logic runs through every type covered in this post. A text field with a six-character length rule still needs a label saying what those characters are for, such as a short company code. A tel field needs a label naming which phone number is wanted. A time field needs its format in the label, since one moment can be written several ways.
Descriptive labels also make the other tools in this post work. A prefix or suffix adds the unit, and the label carries the question. Together they tell the visitor what to type and how to type it. Once the form is built, check every label against the goal of that criterion, and rewrite any label that could fit a different field.
Which one should you pick?
Choose the input type from the data the visitor will type, not from habit. Free words and names fit text, with a length range to set. Quantities that move in steps fit number, with a minimum and a maximum. Codes and phone numbers fit tel, where the numeric keypad helps and spinner arrows would mean little. A clock value fits time, written in a format your team has chosen.
The comparison below sets each option against the figures the sources give for it.
| Data the visitor types | Input type | Limit named in the sources | Figure from the sources |
|---|---|---|---|
| Words or a name | text | minlength and maxlength | 6 characters in MDN's example |
| A quantity in steps | number | min and max | 1 to 10 in MDN's example |
| A long code or phone number | tel | None named in the MDN note | 00001 to 99999 for USA ZIP codes |
| A clock time | time | A chosen format | 23:59 for one moment |
Once the type is set, two more decisions follow. Add a label that names the question, and add a prefix or suffix if the figure needs a unit. These steps apply to every row above, so the choice of type does not change the rest of the field design.
The tel row shows why the match matters. MDN notes that a ZIP code range is too large for incremental increases to make sense, so tel might be the better option there. A ZIP code in a number field would offer spinner steps that carry no meaning for the visitor. Matching the type to the data keeps the browser's controls working for the visitor instead of against them.
A quick review helps too. Go through the form field by field and ask what the visitor is actually giving you. If the honest answer is a word, a count, a code or a moment, the type is usually obvious. If the answer is unclear, that is a sign the question itself needs rewording before any markup is written.
Setting limits and labels in a signup form
Each field on a signup form needs three decisions: the input type, the limits, and the label. The type tells the browser what shape of answer to expect. The limits set the range the browser will accept. The label tells the visitor what to type, and a prefix or suffix adds the unit when the figure needs one. Skipping any of the three leaves a gap that visitors will notice.
Consider a short example with illustrative numbers. A team-size question could use a number field with a min of 1 and a max of 10, following MDN's example. It could be labelled "Team size" with a suffix of "people". A mobile number field could use tel, with a label stating whatever format your system needs. A preferred call time could use time, with one stated format in the label. These figures are examples to adapt, not rules to copy. Set your own bounds from the data your team actually needs, and follow the affix guidance quoted above when a unit is unclear.
The order of work matters too. Set the type first, because it decides which limits apply. Write the label next, because it names the question. Add the affix last, because it depends on the unit the label implies. Then test each field with entries at both ends of its range and with one entry just outside it.
If two fields could share the same label, the labelling test above would point out the overlap. Rewrite one of them so each field has a label that no other field could share. Visitors who finish a form without asking what a box wants are the clearest sign the setup is working.
Related guides: Phone number format: 4 checks for a signup text sender · 3 signup form field bug types and where to report each · Text codes at signup: 4 US number rules to check first.
Reader questions
What does a prefix or suffix actually do? The guidance quoted earlier says an affix helps the visitor see what kind of answer is being requested before they type. It places the unit beside the field, so the visitor reads the kind of answer before typing.
Should a prefix or suffix replace the label? No. The label names the question, and the prefix or suffix supports it. Keep the label in place and use the affix for the unit alone.
Does a descriptive label need to be long? Not necessarily. The success criterion asks that labels help users identify specific components. A short label meets that aim if it names what the field asks for. Length is a means, not a target.
Can a time field accept one moment in more than one format? The MDN example shows that one moment can be written several ways. Your form and your server still need to agree on one format, and the label should state it.
Which type should a phone number use? Usually tel. MDN notes that when incremental steps make no sense, the tel type can be a better option, because it provides the numeric keypad without the spinner.
Do prefixes and suffixes change how the browser checks a value? The quoted guidance describes them as a way to help understanding. It does not describe them as a validation rule, so checks still come from the field's type and its limits.
Are browser checks enough for a signup form? No. The browser catches honest typing errors, but a request can reach your server without passing through your page. Server-side checks are still needed, and they should match the rules in your markup.