<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script>
then add javascript code:
$(document).ready(function() {
$("#form").validate();
});
</script>
jQuery(document).ready(function() {
jQuery("#forms).validate({
rules: {
firstname: 'required',
lastname: 'required',
u_email: {
required: true,
email: true,//add an email rule that will ensure the value entered is valid email id.
maxlength: 255,
},
}
});
});
I don't know
function submitFunction(event){
event.preventDefault();
}
$("#form_id").submit(submitFunction);
form validation