Aria plugin

Add ARIA attributes based on the field validity


The list of ARIA attributes are:
  • aria-invalid, aria-describedby for field element
  • aria-hidden, role for associated error message element
The following piece of code is the starting point to use the Aria plugin:
<link rel="stylesheet" href="/vendors/formvalidation/dist/css/formValidation.min.css" />
<form id="demoForm" method="POST">...</form>
<script src=""></script>
<script src="/vendors/formvalidation/dist/js/FormValidation.min.js"></script>
document.addEventListener('DOMContentLoaded', function(e) {
fields: {
plugins: {
aria: new FormValidation.plugins.Aria(),
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

Try to press the Add product button and inspect the field and error message elements using your browser Developer Tools to see how the ARIA attributes above are added to them.
Aria plugin


  • First release