Integrating with Bootstrap button group

In the following example, you will see how to use FormValidation with the Bootstrap button group.

Basically, we have multiple radios which are wrapper inside a data-toggle="buttons" element:

Customizing icon position

You can ignore this section if you don't use the Icon plugin. In order to show the feedback icon at the desired position, we need to hook on the onPlaced event:

Revalidating the field

Bootstrap 4.3.1 prevents the default action of radio buttons when being used with data-toggle="buttons". So, we need to revalidate the field when it's changed manually:

Tip

You should look at the basic principle when integrating FormValidation with 3rd party libraries

More examples

Related validators

The following validators might be useful to you.