Reading starts here
ChurnAtlas

Email field settings: 4 checks for customer invites

Short answer. Review type, minlength, maxlength, and size on a customer invite form, with examples that explain length validation, display width, and server checks.

ChurnAtlas Editorial Team. How posts are made is set out in the editorial standards.

Published · Sources checked · 13 min read

  1. Inputs The order, the outcome the customer agreed to and the people on both sides.
  2. Decision What counts as a first result and who owns each step.
  3. Next action Write the milestone, its owner and its date on the account page.

Set four email field attributes on a customer invite form: type, minlength, maxlength, and size, then check validation separately from display width.

Key takeaways

  • Use type="email" for the address field.
  • Choose length limits you can explain and test.
  • Set the display width separately from the length limit.
  • Check the address again on the server before sending an invitation.

Why the email field needs its own settings

An invite form for a new customer user usually has a handful of fields: a name, a role, perhaps a team, and an email address. The email field often gets the least attention, but it does the most work. That address receives the invitation, usually becomes the sign-in name, and is the first thing your support team checks when a customer writes in to say they never got the link. A weak email field can create tickets before the customer has even logged in.

When a CS manager reviews an invite form, the usual checks cover the button label, the wording of the help text, and whether the invitation actually sends. The settings on the field itself often go unchecked. They live in the markup, so they are easy to skip, and a plain text box accepts nearly anything a person types into it.

This post covers four settings you can put on an email input: its type, its minimum length, its maximum length, and its size. Each one is an attribute of the HTML input element. The main reference is the MDN Web Docs page on the email input type, and I link to it wherever a specific rule comes from it.

You do not need to write code to use this post. You do need to understand what each setting does, so you can ask the right question when you review a form or brief the person who builds it. If your team uses a form framework or a component library, the underlying attribute names are usually the same, even when the component wraps them under a different name. Check the generated markup if you are not sure. For a broader review, use the guide to onboarding form validation.

Setting 1: Declare the field as type="email"

The first setting is the input type. An email field should be declared as type="email" instead of a plain text box. The type tells the browser what kind of value belongs in the field, and that is the signal your form needs.

The MDN page explains what the email type does and which other attributes work with it. Read it before you change anything. The rest of the settings in this post assume the field is declared as an email input, so the type is the foundation. Check the examples on the page against your own markup, and keep the page open when you review a pull request or a form file.

A plain text box accepts anything. A customer can type a name, a sentence, or a phone number, and the form will take it unless something else stops it. Declaring the type gives the browser a clear idea of what the field is for, so the browser can treat the value as an address. It does not replace checks on your server. Before your system sends an invitation, the server should check the address again. Treat the browser check as a first pass that catches typing mistakes, not as the final word on what goes into your records.

Think about the person on the other end, too. A customer who is invited to a workspace is often filling in the form quickly, sometimes on a phone, and sometimes by pasting an address from an email client. A field that is clearly marked as an email address helps them get it right the first time. Fewer typos means fewer invitations that go to the wrong inbox, and fewer tickets from people who cannot find the email.

What to look for in a review: the email field should use the email type. If a developer has used a generic text input because it seemed simpler, ask them to change it. The change is one word in the markup. It helps the person filling in the form, and it helps your team later when it reads the data, because the field is clearly marked as an address.

Setting 2: Set a minlength

The second setting is minlength. It sets the fewest characters a value may have before the browser counts the field as valid. The MDN page states the rule this way: "The input will fail constraint validation if the length of the text entered into the field is fewer than minlength UTF-16 code units long." The page also says the value must be an integer value of 0 or higher. A negative number or a fraction is not a valid choice.

Here is what minlength does for your form. It checks whether the entered text meets the chosen minimum length. It does not check that the text is a real email address. A value can meet the length rule and still be wrong, such as "abcd" or "name at example". That is why minlength is one of four settings, not the whole check.

The MDN page includes an example that asks for contents "no shorter than 3 characters and no longer than 64 characters." It shows how the two length settings can sit together on one field. It is an example, not advice on the right number for your form. Choose a minimum that fits your customers and the addresses your team expects to see, then test it with real entries before launch. A minimum that is too high can block a valid short address, and a minimum that is too low does very little.

One detail trips up teams. The length is counted in UTF-16 code units, and that is not always the same as the number of letters or symbols a person sees on the screen. If your customers may enter addresses with accented letters or characters from other alphabets, test those cases as well. Otherwise the count may surprise someone, and a valid entry may be rejected.

Review check: confirm that minlength is present and is a whole number of zero or higher. Ask the developer where the number came from. If the answer is "it was copied from another form," that is a sign to ask again.

Setting 3: Set a maxlength

The third setting is maxlength, the upper bound. The MDN page says: "The input will fail constraint validation if the length of the text value of the field is greater than maxlength UTF-16 code units long." As with minlength, the value must be an integer of 0 or higher.

A maximum keeps unusually long entries out of the form. A value far longer than any real address is usually a mistake, a paste error, or someone testing the limits. A value longer than maxlength fails constraint validation when its length exceeds that limit in UTF-16 code units.

The MDN page also shows an example with a maximum of 256 characters: "Here we have an email input with the ID emailAddress which is allowed to be up to a maximum of 256 characters long." That number is there to show the attribute at work. It is not a rule that every team should copy. Before you accept any maximum, ask where it came from. A number copied from a tutorial is not a reason, and a number that someone chose on purpose, with a note, is much easier to review later.

Keep the two length settings consistent. A minimum that is higher than the maximum would make the field impossible to fill correctly, because no value could pass both rules. This is an easy mistake when two people edit the same form at different times, so check both numbers together.

A maximum also does not replace server checks. Keep the server-side limit in place too, since the form is not the only way data reaches your system.

Review check: the field has a maxlength, the value is a whole number of zero or higher, the maximum is larger than the minimum, and the number has a written reason.

Setting 4: Set a size

The fourth setting is size. It controls how wide the box looks on the page, counted in characters. The MDN page says: "The value must be a number greater than zero, and the default value is 20." So a size of zero is not valid, and if you leave the attribute out, the box uses the default of 20.

Size and maxlength are often confused. Both are numbers that show up in the same tag, and both relate to how many characters fit in the box, but they do different jobs. Size controls the display. Maxlength controls what the field accepts.

The MDN page shows how they work together. One example creates a 32 character-wide box with the length limits described above. So the box can be narrower than the longest value it accepts. Another example on the page sets both attributes to 64: "Its size and maxlength attributes are both set to 64 in order to show room for 64 characters worth of email address, and to limit the number of characters actually entered to a maximum of 64." Either approach can be correct. The point is that the two numbers answer different questions.

In practice, pick a width that lets the customer see most of what they type without scrolling the box, and set maxlength to match your rule. A narrow box does not stop a long address, and a wide box does not add a check. If the box is too narrow, the customer may think the address is cut off when it is not, which causes confusion. If it is too wide, the form may look unbalanced next to the other fields.

Review check: size is greater than zero, or it is left out so the default of 20 applies. The width matches the rest of the form. The limit is set separately with maxlength, and both numbers have a reason you can explain.

How the four settings fit together

The following markup shows all four settings on a customer invite form. The numbers illustrate where each setting goes. They are not recommendations.


<label for="invite-email">Email address</label>
<input
  type="email"
  id="invite-email"
  name="email"
  minlength="3"
  maxlength="64"
  size="32">


Read the markup as four questions. The type asks what kind of value belongs here. The minlength asks how short is too short. The maxlength asks how long is too long. The size asks how wide the box should look. Each question has its own answer, and none of them answers the others. A review that asks all four catches most of the problems in this post.

Keep the label visible and clear. A label such as "Email address" tells the customer what to type, and it gives screen readers a name for the field. If the form has a help line, make it match the limits. A help line that says "up to 64 characters" should match the maxlength, and no help line should promise a rule the field does not enforce.

Illustrative example: Check the length separately

An entry measuring 20 meets both length limits; one measuring 250 exceeds the maximum and fails the length check. This checks length only, not whether the entry is an email address. These numbers demonstrate the comparison, rather than recommend limits for your form.

When a customer says the form rejected a valid address

Sooner or later, a customer will write in to say the form would not take an address they know is correct. Treat that report as information about the form, not as a support ticket to close quickly. Ask for the exact address they typed, if they are comfortable sharing it, and for the message the form showed. The checks below take a few minutes.

Start with the length settings. Is the address shorter than the minimum or longer than the maximum? Keep in mind that the count uses UTF-16 code units, so an address with accented letters or characters from other alphabets may count differently than the customer expects. If the address is inside your limits, the length settings are not the cause.

Next, check the type. If the field is a plain text box, the browser is doing less work, and the problem may lie somewhere else in your form or your server. If the field is declared as an email type and still rejects a valid address, the problem may be in the server rules or in a script on the page.

Then decide whether the limit is wrong. If real customers keep hitting the same limit, the number may be too strict. Change it on purpose, write down the new number and the reason, and tell the team which other forms use the same setting. Do not loosen one form's limit without checking the others, or your rules will drift apart.

Finally, check the server. If the browser accepted the value and your system still refused it, ask whether a server check rejected it. Ask the developer which check ran and why, and decide whether the form should match the server rule. Fix whichever one is wrong. A form that promises one rule while the server enforces another creates a confusing experience, and it is harder to fix once customers depend on it.

A short review checklist

Use this list when you review a form before launch:

  1. The field is declared as type="email".
  2. minlength is present, is a whole number of 0 or higher, and has a written reason.
  3. maxlength is present, is a whole number of 0 or higher, and is larger than the minimum.
  4. size is greater than zero, or it is left out so the default of 20 applies, and the width fits the layout.
  5. The server checks the address again before it sends an invitation.
  6. The label and help text match the limits the field enforces.

For the rest of the form review, see onboarding forms before your next send.

What to tell the person who builds the form

When you hand the work to a developer, give them the four settings by name and say why each one matters. Link them to the MDN page so they can read the rules themselves. A short brief is enough: the email field must use the email type, must have a minimum and a maximum length with a reason for each, and must have a size that fits the layout. Keep the brief in writing and store it with the form's ticket, so the next person who edits the form can see the reasons.

Ask for a short test plan. The test should include an empty field, a single character, a normal address, a very long address, and an address with characters from another alphabet or with accents. Ask the developer to record what the form does for each case. If the results are unexpected, the limits need another look before the form ships.

What to do today

Open your customer invite form and use the review checklist above. Record the current settings and ask the developer to explain any limit without a written reason. Keep that note with the form's ticket.

Related guides: Multi-page form progress: 7 settings to check · Accessibility dates: 6 checks for customer answers · Accessible password fields: 8 settings to check.

Questions about email field settings

Does minlength check the email format?

No, minlength checks length rather than email format. Text can meet the length rule and still be wrong.

Should size match maxlength?

No, size and maxlength can differ. Choose the display width for the layout and the maximum length for the value the field accepts.

Which numbers should I copy from the examples?

Choose limits for your own form rather than copying example numbers. Test the choices with the addresses your customers use.

Sources

Sources checked

Limits of this post

This post is general operational information, not legal advice about notice periods or renewal clauses. It does not promise that any method keeps a customer. Software can get a fact wrong, so open the sources before you act.