function fm_chk(fm)//主调用
{
var isPass=true
for(var i=0;i <fm.length;i++)
{
if((fm[i].alt+ " ").indexOf( ": ")==-1)
continue;
if(typeof(document.memberform.ismail)!= 'undefined ')
{
if(fm[i].name== 'email ' && !document.memberform.ismail.checked)
continue;
}
if((fm[i].name== 'safe_num ' || fm[i].name== 'safe_num2 ' || fm[i].name== 'identityinfo ' || fm[i].name== 'identityNum ') && !document.memberform.issafe.checked)
continue;
if(fm[i-1].name== "selectQ " && fm[i-1].value!=9 && fm[i].name== "pwdQ ")
continue;
if(!tx_chk(fm[i]))
{
isPass=false;
fm[i].style.background= '#FF0000 ';
}
}
if(isPass)
{
fm.Submit.disabled = true;
fm.checkname.disabled = true;
return true;
}
else
{
alert( "您填写的信息有误,请根据页面红字更改! ")
return false
}
}
除了return请逐行给加注释!!
------解决方案--------------------------------------------------------
它似乎就是这样做的吧