js代码:
function getCheckedCount() {
var o = document.getElementsByTagName("input");
var intCheckCount = 0;
var pattern = new RegExp("^" + arguments[0]);
for(var i=0;i<o.length;i++){
if(o[i].type == "checkbox" && pattern.test(o[i].name) && o[i].checked){
intCheckCount++;
}
}
return intCheckCount;
}
然后在submit组件中加上onclick方法来调用判断