-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
  • 98,165
  • 25
  • 199
  • 285
Jayakrishnan
  • 271
  • 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,650
  • 2
  • 23
  • 32
  • 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,373
  • 17
  • 20
  • As per developer, `ignore: []` is the proper syntax. See: http://stackoverflow.com/a/8565769/594235 – Sparky Feb 27 '13 at 16:28