jquery validator does the submission even it's invalid
I am writing a form with jquery.validate the roles work on keyup but don't work on onblur. and if the form fields were invalid and hit submit it works and submit
- $('#myform').validate({
- rules: {
- name: {
- required: true,
- minlength: 2
- },
- code: {
- required: true,
- minlength: 2
- },
- description: {
- require: true
- },
- credit: {
- required: true,
- number: true,
- range: [1,5]
- }
- },
- messages: {
- name: "Please Enter The Course Name",
- description:"Please Enter The Course Description",
- code: "Please Enter The Course credit",
- credit: {
- required:"Please Enter The Course Code",
- number: " Must be a number.",
- range: "Must be between 1 and 5."
- }
- }
- });