斑竹,为什么不执行document.form1.sid.focus();这句了,每次点了确定后
<script language="javascript">function checkform()
{
var message="你注册的信息为:"
if(document.form1.sid.value=="")
{
alert("输入用户名!");
document.form1.sid.focus();
}
if(document.form1.name.value=="")
{
alert("输入姓名!");
document.form1.name.focus();}
if(document.form1.pass1.value=="")
{
alert("输入密码!");
document.form1.pass1.focus();
}
if(document.form1.pass2.value=="")
{
alert("输入确认密码!");
document.form1.pass2.focus();
}
if (document.form1.pass1.value!=document.form1.pass2.value)
{
alert("重新输入密码!");
document.form1.pass1.focus();
}
var address=document.form1.email.value;
if((address=="")||(address.indexOf([email=]'@')==-1)||(address.indexOf('.')==-1[/email]))
{
alert("邮址不正确!");
document.form1.email.focus();
}
var myindex=form1.area.selectedIndex;
message+="用户名为:"+document.form1.sid.value+" ";
message+="姓名为:"+document.form1.name.value+" ";
message+="来自:"+form1.area.options[myindex].value+" ";
message=message+"email"+address+" ";
alert(message);
}
</script>
</head>
<body>
<div align="center"><br />用户注册(注:*为必填项)</div>
<table width="319" border="0" align="center">
<tr>
<td width="313">
<form name="form1" >
<p>用户名:<input type="text" name="sid">**</p>
<p>姓 名:<input type="text" name="name">**</p>
<p>密 码:<input type="password" name="pass1">**</p>
<p>确认密码:<input type="password" name="pass2">**</p>
<p>性 别 :<input type="radio" name="sex" value="男"checked="checked">男
<input type="radio" name="sex" value="女">女</p>
<p>来自省份:<select id="area" type="tableIndex=6" size="1" name="area">
<option selected>==来自哪个省==</option><option value="其他">其他</option>
<option value="山西">山西</option><option value="陕西">陕西</option>
<option value="北京">北京</option><option value="上海">上海</option>
<option value="天津">天津</option><option value="重庆">重庆</option>
</select>
</p>
<p>email:<input type="text" name="email">**</p>
<p><input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重写">
</p>
</form>
</td>
</tr>
</table>