Semstrap

Form examples

Validating required inputs

Browsers will automatically do some basic validation based on the input type. Below are som examples of input fields that do basic validation and visually indicate failure/success. The latter example uses the pattern attribute to validate using a regex pattern.

Adding the required attribute to an input field will make will make it impossible to submit the form without entering a value.

Textarea

A field for writing multiline text input

Select

This dropdown input lets you select from a fixed set of items

Radio buttons

Checkboxes

Special input fields

There are specialized input fields available. These look like the text input field but trigger different keyboard layouts on mobile and tablet devices and can make use of validation.

Sample fields

Form buttons