Excluded plugin

Ignore validations on particular field


This plugin allows you to indicate fields which won't be validated. By default, the plugin will not validate the following kind of fields:
  • disabled
  • hidden
  • invisible
The following piece of code is the starting point to use the Excluded plugin:
<link rel="stylesheet" href="/vendors/formvalidation/dist/css/formValidation.min.css" />
<form id="demoForm" method="POST">...</form>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.3/es6-shim.min.js"></script>
<script src="/vendors/formvalidation/dist/js/FormValidation.min.js"></script>
document.addEventListener('DOMContentLoaded', function(e) {
fields: {
plugins: {
excluded: new FormValidation.plugins.Excluded({
excluded: function(field, element, elements) {
// field is the field name
// element is the field element
// elements is the list of field elements in case
// we have multiple elements with the same name
// return true if you want to exclude the field
The sample code above assumes that the FormValidation files are placed inside the vendors directory. You might need to change the path depending on where you place them on the server.

Basic example

In the following form, there are two invisible fields called Job title and Department. Since they are not visible initially, they will not be validated when you click the Submit button. Clicking the More info button will turn them into visible fields, and as result, they will be required due to their validation rules.
Excluded plugin

See also


  • First release. It means that the Excluded plugin requires FormValidation v1.3.0 or newer