我看到 jqGrid 有自己的内置网格验证属性,如
editrules:
{
required: true,
email: true
}
但是,我有一个布尔函数来检查电子邮件是否有效:
function isValidEmailAddress(emailAddress)
{
var emailPattern = new RegExp(/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i);
return emailPattern.test(emailAddress);
}
如何根据此功能的结果强制验证器检查电子邮件?