新手的问题,请大家帮个忙啊!!!
看我这个表单,为什么提交后只是刷新了一下而不显示注册信息呀,并且只验证第一行的内容,后面的就没有验证呀??????帮忙找一下错误啊,我找了半天了,就是不知道怎么了啊???
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<title> 邮件帐户信息 </title>
<script>
function my()
{
f=document.myform;
if(f.ming.value== " "||f.email.value== " ")
{
alert( "请填写完整! ");
return false;
}
var re=/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
if(!re.test(f.email.value))
{
alert( "邮件格式错误!!! ");
return false;
}
if(f.mybox[0].checked==false&&f.mybox[1].checked==false&&f.mybox[2].checked==false&&f.mybox[3].checked==false&&f.mybox[4].checked==false)
{
alert( "至少选择一项! ");
return false;
}
var s= " ";
for(var i=0;i <f.mybox.length;i++)
{
if(f.mybox[i].checked==true)
{s=s+f.mybox[i].value+ " ";}
}
if(f.tu.value== " ")
{
alert( "图片不能为空! ");
return false;
}
var a=f.ming.value;
var b=f.lei.value;
var c=f.jin.value;
var d=f.email.value;
var e=f.mybox.value;
var g=f.tu.value;
document.write( " <h2> 您的注册信息如下: "+ " </h2> ");
document.write( " <hr> ");
document.write( "物业名称: "+a+ " <br> ");
document.write( "物业类别: "+b+ " <br> ");
document.write( "租金范围: "+c+ " <br> ");
document.write( "EMAIL: "+d+ " <br> ");
document.write( "公交路线 "+e+ " <br> ");
document.write( "图片: "+g);
}
</script>
</head>
<body bgcolor= "#CAE4FF ">
<h1 align= "center "> <font color= "#0033FF " face= "华文彩云 "> 请输入房源信息 </font> </h1>
<form name= "myform " onSubmit= "return my() ">
<table bgcolor= "#CAE4FF " align= "center " border= "2 ">
<tr>
<td> 物业名称: <input type= "text " name= "ming " value= " "> </td>
</tr>
<tr>
<td>
物业类别: <select name= "lei ">
<option selected value= "公寓 "> 公寓 </option>
<option value= "旅馆 "> 旅馆 </option>
<option value= "酒店 "> 酒店 </option>
</select>
</td>
</tr>
<tr>
<td>
租金范围: <select name= "jin ">
<option selected value= "2000~3000¥ "> 2000~3000¥ </option>
<option value= "3000~4000¥ "> 3000~4000¥ </option>
<option value= "4000~5000¥ "> 4000~5000¥ </option>
</select>
</td>
</tr>
<tr>
<td>
EMAIL: <input type= "text " name= "eamil ">
</td>
</tr>
<tr>