I try to listen for an error in the second field.
I have an issue it will not be added a class to the button. Is it technically possible to do this?
A button is pushed on the second element under an error but an error is under input cell. So, I try to add a new class to the button when an error arise for the second element. I have used if (input.dataset.parsleyId === '13')
`
$(document).ready(function()
{
var parsleyConfig = {
errorsContainer: function(parsleyField) {
return $('#errors');
}
};
$("form").parsley(parsleyConfig);
if (input.dataset.parsleyId === '13') {
button.setAttribute("class", "fixed-margin-button1");
}
$("form").on('submit', function(e)
{
var f = $(this);
f.parsley().validate();
if (f.parsley().isValid()) {
alert('The form is valid');
} else {
alert('There are validation errors');
}
e.preventDefault();
I try to listen for an error in the second field. I have an issue it will not be added a class to the button. Is it technically possible to do this? A button is pushed on the second element under an error but an error is under input cell. So, I try to add a new class to the button when an error arise for the second element. I have used if (input.dataset.parsleyId === '13') ` $(document).ready(function() { var parsleyConfig = { errorsContainer: function(parsleyField) { return $('#errors'); } };
$("form").parsley(parsleyConfig); if (input.dataset.parsleyId === '13') { button.setAttribute("class", "fixed-margin-button1"); }
$("form").on('submit', function(e) { var f = $(this); f.parsley().validate();
} ); } ); `