Here is my jquery code for form validation: I am facing issue with below code like even replace the expression with the field the functionality is not working
below is the code:-
$(document).ready(function() {
$(".submit").click(function() {
$("#myForm").validate({
rules: {
'name': { // this is value of the name attribute of your field
required: true,
},
'email':{
required:true,
// regex: 'regex for email field goes here'
} ,
'phone':{
required: true,
}
},
messages: {
'name': {
required: "Name is required"
},
'email': {
required: "Email is required",
//regex: 'Error response for regex fail goes here'
},
'phone':{
required: "phone number is required",
}
}
});
});
});
Now how can i add the regex expressions for email phone number,name field.
i am new to jquery can anyone help me adding the expression?