How to Make Your Fields Required with Custom HTML OptinMonster Campaigns

OptinMonster makes it easy to add required fields to your custom HTML campaign form in the OptinMonster builder.

In this article, you’ll learn how you can make your campaign form fields required with our custom HTML integration.

Before You Begin

Here are some things to know before you begin:

  • Due to the custom nature of a custom HTML implementation, at this time we do not provide support for making form fields required.

Use HTML5’s Required Attribute

The easiest solution is to use HTML5’s required attribute.

This can be done by adding the attribute to the end of each input field you wish to make required, like the following:

<input type="email" placeholder="Enter your email here..." required />

Browser Support

*The numbers in the table specify the first browser version that fully supports the attribute.

Attribute Chrome Internet Explorer Firefox Safari Opera
required 5.0 10.0 4.0 5.0 9.6

Advanced Field Validation

It is also possible to do more advanced field validation using JavaScript.

See this guide for more information to get started with advanced form field validation.