代码运行不出效果,help
<script language="javascript" type="text/javascript"><!--
function showF(){
var userInfo="";
for(var i=0; i<document.form1.length;i++){
var oElement=document.form1.elements[i];
if(oElement.type=="text"||oElement.type=="password"){
if(oElement.value==""){
alert("此表单字段不能为空!");
oElement.focus();
return;
}
}
}
userInfo="用户名:"+document.form1.elements["textfield"].value+"; ";
userInfo+="密码:"+document.form1.textfield2.value+"; ";
userInfo+="电子邮件:"+document.form1.h.value;
document.all.p1.innerHTMl=userInfo;
}
-->
</script>
</head>
<body>
<form id="form1" method="post" action="">
<table width="200" border="1">
<tr>
<td>
用户名:
<label>
<input type="text" name="textfield" id="textfield" width="50px"/>
</label>
</td>
</tr>
<tr>
<td>
密码:
<label>
<input type="password" name="textfield2" id="textfield2" width="50px"/>
</label>
</td>
</tr>
<tr>
<td>电子邮件:
<input name="" type="text" id="h" width="50px"/></td>
</tr>
<tr>
<td>
<input name="but" type="button" id="but" value="确定" onclick="showF();"/>
</td>
</tr>
</table>
</form>
<p align="center" id="p1"></p>
</body>
</html>