I have a multipage form where I want to force any validation rules prior to allowing the user to move to the next section. I want to keep the method as generic as possible and was hoping I could simply call .validate based on the html markup rules.
Each page is divided into separate field sets.
The site is running bootstrap 4 and jquery.
I have the following method for shifting to the next page of the form;
function nextFormPage() {
var slidingOut = false;
$('#form > fieldset').each(function (key, value) {
if ($(this).is(':visible')) {
//if ($(this).validate()) {
$(this).slideToggle();
slidingOut = true;
//}
return;
}
if (slidingOut) {
$(this).slideToggle();
slidingOut = false;
}
});
}
I have tried installing the jquery validation plugin, but this seems to want me to add the rules through javascript, whereas I would rather just validate from the basic html rules?
Does anyone have any ideas please?