📜  jquery 验证器添加方法 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:15.785000             🧑  作者: Mango

代码示例1
jQuery.validator.addMethod("laxEmail", function(value, element) {

  // allow any non-whitespace characters as the host part

  return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@(?:\S{1,63})$/.test( value );

}, 'Please enter a valid email address.');