0

i m using validate.js.

 var v = $("#form1").validate({
                    ignore: ':hidden',
                    rules: {
                        txtName: { required: true },
                        txtTitle: { required: true }
                        txtInterval:{///Only allow integer}

                    },
                    messages: {
                        txtName: "<br/>Please enter a Name",
                        txtTitle: "<br/>Please enter a Title",
                        txtInterval:"<br/>Please Enter a Integer"
                    }
                });

Code Works fine i want to validate txtInterval which allow only integer value but don't know how to do this through validate.js.Show me a correct way.Thanks.

1 Answer 1

1
$("#myform").validate({
  rules: {
    field: {
      required: true,
      number: true
    }
  }
});

Read Documentation

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.