2

CKEditor and hidden Field on same Form..

i used ignore : [ ] and ignore : ':hidden' on validate...

but not working properly ....

$("#testform").validate({
                ignore: [],
                        rules :{    
            txt : "required",
             question: {
                    required: function() {
                        CKEDITOR.instances.question.updateElement();
                    }
                },              
            txt1 : "required",          
        }           
        });

How to validate Ckeditor and ignore hidden fields?

See Demo : http://jsfiddle.net/UI_Designer/qu2borh1/

Sparky
  • 98,165
  • 25
  • 199
  • 285
USER10
  • 939
  • 11
  • 28
  • `ignore: []` is telling the plugin to ignore **nothing**. `ignore: ':hidden'` is telling the plugin to ignore **hidden elements but that's already the default** behavior. You have to take the time to learn about what you are doing so you can better understand why it's not working as expected. – Sparky Feb 19 '15 at 15:54
  • 1
    @user10 Regarding your latest question you just deleted. Check this link: http://jsfiddle.net/pd8wgvLq/3/ – dfsq Mar 04 '15 at 13:52

1 Answers1

3

to fix it use ignore: ".hide"

or for ignore : ':hidden' to work change the type of the input in hidden

$("#testform").validate({
                ignore: ".hide",
                        rules :{    
            txt : "required",
             question: {
                    required: function() {
                        CKEDITOR.instances.question.updateElement();
                    }
                },              
            txt1 : "required",          
        }           
        });
Vladu Ionut
  • 8,075
  • 1
  • 19
  • 30