Require Form Fields
Overview
You can have users require a selection or input in your forms before submitting it. This can be applied to any form field type.
How To Use
To have required fields in forms you must do the following:
- Add a form item container
- Add the required class to the form item container
Markup
In the div
element with the class of form-item
, add a required
class to make that form item required to be filled before submitting a form.
Example Code
<div class="form-item required">
<label>Your Custom Text Field</label>
<input class="form-control" name="contact[your-custom-text-field]" type="email">
</div>