[SOLVED] jquery validate - Cannot call method 'call' of undefined
Good afternoon,
I think i found a bug with a cutom validation rule.
When the form is submited without modify any field, the custom rule is called. But if you set email field and give a password, you get an error (tests realised with chrome) :
Uncaught TypeError: Cannot call method 'call' of undefined
-
-
-
-
-
-
-
I tried different versions of jquery and jquery validation, it is the same. I created a minimal code to reproduce it.
Can you help me ? Thanks in advance :)
- <!doctype html>
- <html>
- <head><title></title>
- <script src="jquery.min.js"></script>
- <script src="jquery.validate.min.js"></script>
- </head>
- <body>
- <script>
- $(document).ready(function(){
- function completed()
- {
- return $("#aaa ul li").length == $(".aaa_selectedValue").length;
- }
- jQuery.validator.addMethod("isCompleted", function(value, element) {
- return completed();
- }, "Not finished");
-
- $("#formConnection").validate({
- ignore: ':hidden:not("#resultId")',
- rules: {
- login: { required: true, email:true },
- pwd: { required: true, password: true },
- result: {isCompleted : true}
- }
- });
- });
- </script>
- <form id="formConnection" action="" method="post" novalidate="novalidate">
- <label>E-mail *</label>
- <input type="text" name="login" value="">
- <label>Mot de passe *</label>
- <input type="password" name="pwd">
- <div id="aaa">
- <ul><li class="aaa_selection">a</li><li>b</li></ul>
- </div>
- <input type="hidden" name="result" id="resultId" value="">
- <input type="submit" id="btnConnection" name="validate" value="Connexion">
- </form>
- </body></html>
[MODERATOR: ADDED THE PAGE TO THE POST]