$('body').on('submit', '#user_edit', e => {
e.preventDefault();
$(e.currentTarget).validate({
rules: {
firstname: {
required: true,
},
lastname: {
required: true,
},
},
errorPlacement(error, element) {
if (element[0].localName === 'select') {
error.insertAfter($(element[0]).next());
}
else {
error.insertAfter(element);
}
}
});
})