var checkyou=document.getElementsByName(‘checkyou[]‘);
var isSel=false;
for(var i=0;i<checkyou.length;i++)
{
if(checkyou[i].checked==true)
{
isSel=true;
break;
}
}
if(isSel==false)
{
alert("请选择产品属性!");
return false;
}
<form action="index.php?module=RProduct&action=add" method="post" onsubmit="return check(this);" enctype="multipart/form-data">
<input name="checkyou[]" type="checkbox" value="{$shuxing->id}" />
</form>
时间: 2024-09-29 05:42:45