我用的是这。
太棒了。我只需要添加一个函数,检查是否输入了"cp“、"bp”、"hp“输入区域。如果没有,应该会出现一个错误:“请输入至少一个电话号码。”
(cp =手机,bp =商务电话,hp =家用电话)
发布于 2012-01-11 18:35:10
function checkPhones(){
var frm = document.forms["myform"];
var cell = frm.cp.val;
var bus = frm.bp.val;
var home = frm.hp.val;
if(ValidatePhone(cell) || ValidatePhone(bus) || ValidatePhone(home)){
return true;
}
return false;
}
function ValidatePhone(val){
//insert code to check phone meets your system requirements
//either length or pattern
//return true or false
}
frmvalidator.setAddnlValidationFunction("checkPhones");https://stackoverflow.com/questions/8824568
复制相似问题