0

I want to change the ready event into a keyup event.

My code:

$(document).ready(function(){
   $('#coke').validate({
      rules : {
      coek : {
         required: true,
         minlength: 6,
         maxlength: 6
         }
      },
      messages: {},
      errorElement : 'div',
      errorLabelContainer: '.errorTxt'
   });
});
Mario Murrent
  • 712
  • 5
  • 24
Anggi alansori
  • 85
  • 1
  • 11

1 Answers1

2

You could do something like, assuming you want to attach the keyup event to you input not the whole document.

$(document).ready(function(){
    $("#coke").bind('keyup', function(e) {
        // your code here
    });
});
Mario Murrent
  • 712
  • 5
  • 24