2014-02-25 70 views

回答

0

如果你只需要爲$url$email的validaton:

$(document).ready(function(){ 
    $('#jsValidateSubdomain').validate({ 
    rules: { 
     email: { 
     minlength: 2, 
     required: true 
     }, 
     url: { 
     minlength: 2, 
     required: true 
     } 
    }, 
     highlight: function(element) { 
      $(element).closest('.control-group').removeClass('success').addClass('error'); 
     }, 
     success: function(element) { 
      element 
      .text('OK!').addClass('valid') 
      .closest('.control-group').removeClass('error').addClass('success'); 
     } 
    }); 

});