DefaultSubmit plugin

Submit the form if all fields are valid after validating


The following piece of code is the starting point to use the DefaultSubmit plugin:
<link rel="stylesheet" href="/vendors/formvalidation/dist/css/formValidation.min.css" />
<form id="demoForm" method="POST">
<!-- Do NOT use name="submit" or id="submit" for the Submit button -->
<button type="submit">Submit</button>
<script src=""></script>
<script src="/vendors/formvalidation/dist/js/FormValidation.min.js"></script>
document.addEventListener('DOMContentLoaded', function(e) {
fields: {
plugins: {
defaultSubmit: new FormValidation.plugins.DefaultSubmit(),
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.
Instead of submitting the form, you can use an Ajax request to send the form data to the server.
If you want the form to be validated automatically when pressing its Submit button, use the SubmitButton plugin


  • First release