Use modal with form validation
walslayer opened this issue · 0 comments
walslayer commented
Hi,
I want to use form validation to validate my form before to save informations.
But the validation function doesn't work.
Do you have any idea why this function doesn't work in modal ?
Thanks in advance for you interest and your reply!
Have a good day!
$(document).ready(function() {
$('#modal-form').on('shown.bs.modal', function(e){
console.log('hello world!');
$('#form-user').validate({
rules:{
ztLastname:{
required: true
},
ztFirstname:{
requierd: true
},
ztEmail:{
requiered: true
}
},
messages:{
ztLastname:{
required: "Indicate your lastname."
},
ztFirstname:{
required: "Indicate your firstname."
},
ztEmail:{
required: "Indicate an email."
}
}
});
});
});