JQuery plugin Confirm: onfocusin not working

This famous jQuery plugin called Validate has the onfocusout option. But I want to use another, called "onfocusin", which is not documented, but exists inside the code, and the plugin author quoted it in response.

The code I tried:

    <script type="text/javascript">
   $(document).ready(function() {
    $("form").validate({
     onsubmit: false,
     onkeyup: false, 
     onfocusin: true,
     onfocusout: false,
     rules: {
      nome: {
       required: true,
       minlength: 5
      }
     }
    })
   })
  </script>
 </head>
 <body>
  <form action="tutorial.php" method="post" enctype="text/plain" >
   <input type="text" name="nome" id="nome" />
   <button type="submit">Submit</button>
  </form>
 </body>

And FireBug shows this error message when I 'focusin' the input:

validator.settings[eventType].call is not a function [Stop on this error] 
validator.settings[eventType] && v...eventType].call(validator, this[0] ); 
jquery...date.js (line 305)

Now, the golden question: how can this be fixed?

References:

Confirm plugin:

bassistance.de/jquery-plugins/jquery-plugin-validation/

Confirm documentation, parameters page:

docs.jquery.com/Plugins/Validation/validate#toptions

Check plugin code:

ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.js

Confirm author response to abouth onfocusin:

groups.google.com/group/jquery-en/browse_thread/thread/652418e93c9618f1?pli=1

+3
2

onfocusin: true, :

onfocusin: function(element) { $(element).valid(); }


validator.settings[eventType] && ...eventType].call(validator, this[0] );

onfocusout, :

onfocusout: function(element) { $(element).valid(); }

, .

+7

"true" ( bool) onsubmit, onkeyup, onfocusin onfocusout. ( ). , "false" "undefined" ( ")". , . . v1.9.

+1

Source: https://habr.com/ru/post/1785910/


All Articles