Validating form fields with ajax
This is achieved by grouping together validation functions in "modules", making it possible to load only those functions that's needed to validate a particular form.
This plugin is available through cdnjs, npm, bower and github.
You can use the setup function if you want to change the border color to something else, set the property to an empty string if you don't want the border color to change when the input has an invalid value.
The If wanting to use a custom method that handles the displaying/removing of error messages you should use the two methods described above.
Modifying the server request The parameter containing the input value, sent to the server, will by default have the same name as the input.
Here you can see an example code where we collect all the error dialogs during the validation and pass them on to a custom function displaying the error dialogs.
If it has not been submitted, skip the validation and display a blank form.
However, in the example above, all input fields are optional.
Only the first checkbox element in the group needs to have the validation attributes added.