SubmitButton plugin

Automatically validate the form when pressing its Submit button


The following piece of code is the starting point to use the SubmitButton plugin:


document.addEventListener('DOMContentLoaded', function(e) { FormValidation.formValidation( document.getElementById('demoForm'), { fields: { ... }, plugins: { submitButton: new FormValidation.plugins.SubmitButton(), ... }, } ); });

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.


If you want the form to be submited to the server after pressing its Submit button and all fields are valid, use the DefaultSubmit plugin


Try to press the Add product button to see the form will be validated.