Input field, how would I prevent 3 or more consecutive characters?

Input field, how would I prevent 3 or more consecutive characters?

Using an Input field, how would I prevent 3 or more consecutive characters?

Thanks
  1. var validator = $("#signupform").validate({   
  2.     rules: {
  3.             firstname: {
  4.                 required: true,
  5.                 minlength: 3,
  6.                 maxlength: 30
  7.             },
  8.             lastname: {
  9.                 required: true,
  10.                 minlength: 3,
  11.                 maxlength: 30
  12.             },