请问这个错在哪里?无法取得form对象
<html><head>
<script type="text/javascript">
function CheckAll(formId)
{
var e,i;
frm = document.getElementById(formId).name;
e = document.frmName.num;
for(i=0;i<e.length;i++)
{
if(e[i].checked == false)
{
e[i].checked = true;
}
else
{
e[i].checked = false;
}
}
}
</script>
</head>
<body>
<form name="tstForm" id="testid">
<input type=checkbox name="num">1</input>
<input type=checkbox name="num">2</input>
</br>
<input type=checkbox name=chkallbox onclick="CheckAll("testid")">all
</form
</body>
</html>