日期:2014-05-20  浏览次数:20866 次

表单提交
<script>
function   my()
{
f=document.myform;
if(f.ming.value== " ")
{
alert( "请填写完整! ");
f.ming.focus();
return   false;
}
return   true;
var   ming=f.ming.value;
document.write( " <h2> 您的注册信息如下: </h2> ");
document.write( " <hr> ");
document.write( " <br> 物业名称: "+ming);
}
</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>
</table>
<p   align= "center "> <input   type= "submit "   name= "cheng "   value= "完成 "> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input   type= "reset "   name= "chong "   value= "重写 "> </p>
</form>
</body>

------解决方案--------------------
return true;
这行,写到脚步方法的最后一行。
------解决方案--------------------
删掉return true;

相关资料更多>