-3

I have a form name="myform" but there is exists hidden fields So i want to validate those fields also, how to validate hidden fields using jquery form validation?

Sparky
  • 96,628
  • 25
  • 194
  • 277
Jayakrishnan
  • 261
  • 1
  • 3
  • 3

2 Answers2

0

You can use jQuery.validate plugin that allow to validate hidden fields.

Just set ignore : false; or $.validator.setDefaults({ ignore: '' }); and that will allow you to validate hidden fields.

Official Site : http://bassistance.de/jquery-plugins/jquery-plugin-validation/

Devang Rathod
  • 6,434
  • 2
  • 22
  • 31
  • As per developer, `ignore: []` is the proper syntax. See: http://stackoverflow.com/a/8565769/594235 – Sparky Feb 27 '13 at 16:28
0

override the ignore variable and set it to empty:

$("#form").validate({
    ignore: "",
    rules: {
        something: {
            number:true,
        }
    }
});
Rahul Chipad
  • 2,253
  • 16
  • 19
  • As per developer, `ignore: []` is the proper syntax. See: http://stackoverflow.com/a/8565769/594235 – Sparky Feb 27 '13 at 16:28