帮我看看这程序哪里错了
<form name="form1" ><input name="text1" type="text" id="text1" size="10">
<input type="submit" name="Submit" onClick="num()" >
</form>
<script language="javascript">
function num()
{ var flag1=false;
var compStr="4567839012";
var a=from1.text1.value;
var length2=a.length;
for (var iIndex=0;iIndex<length2;iIndex++)
{ var temp1=compStr.indexOf(a.charAt(iIndex));
if(temp1==-1)
{ flag1=false;
alert("不对") ;
break;
} else
{flag1=true;} } return flag1; }
</script>