Forms

One of the most important types of interaction for clients using our products.

Don't just put together a form, design it.

UsageOverview

Forms are crucial interaction patterns in our products, facilitating tasks such as registration, purchasing, and support. They should be designed thoughtfully to enhance user experience and efficiency.

How to Use When to Use When Not to Use Anatomy Behaviors Interactions Accessibility Related Components StyleMaster Brand form elements

ULTRUS form elements

CodeGuidelines

Where appropriate, use HTML5 input types to ensure ease of use, particularly on touch devices. The email input type is especially useful in mobile browsers, but all types to consider include:

*Note: On mobile devices, tel type puts the user into the number keypad rather than the regular keyboard. Use tel as the preferred type when coding a numbers-only input.

Use the following types with caution, as the implementation in some (or all) browsers may be confusing and vary dramatically in presentation:

All major browsers support the number input, but display may vary. Because several browsers include some kind of spinner UI (up/down arrows to increment the input), some users may be confused by the type of field, while others are familiar with it. To mitigate this problem, you can use input attributes and browser-specific styling in your implementation, or consider an alternate input, such as tel.

Submit events

Forms should generally be executed with input elements of type="submit". Use this tag rather than <input type="button">.

Attach all JavaScript triggers to form and field events, however, rather than click events of a button or link. The allows users to submit forms or tab through form fields with keys, within a touch device keyboard, or by other methods (especially those used by accessibility browsers); attaching events to form submits circumvents problems that may arise from any alternate input scenario.

JavaScript validations

In most cases, JavaScript validations are not necessary. Some situations may make client-side validation more useful to the user, however.

You may potentially want to use client-side validations when:

While client-side validation is often an expedient and helpful pattern, consider certain drawbacks:

Best practices