主题:  如何在提交表单的时候是弹出新窗口?

秋冰梦

职务:普通成员
等级:6
金币:5.0
发贴:4325
#12007/7/5 22:09:07
本人菜鸟,代码一窍不通,实在是研究不明白了,请教高人指点下!

默认是提交表单后当前页直接进入

<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><DIV><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#004E98"> <span class="style44"> <span class="STYLE1"><a href="http://mail.cncwing.com" target="_blank" class="style31">邮箱登陆</a></span></span> <span class="STYLE1"><a href="http://www.hao123.com/mail.htm" target="_blank" class="style44 style31">申请邮箱</a></span></td>
</tr>
<tr>
<td height="70"><table width=100% border=0 cellPadding=0 cellSpacing=0
bgcolor=#F0F7FF valign=top>
<tr>
<form name=loginmail onsubmit="return chkinput2(this);" action=http://www.hao123.com/sendmail.php method=post>
<td align=center background><div align="center" class="style47 STYLE1">用户名:
<input tabIndex=1 size=14 name=user>
<br>
<select
tabIndex=2 name=site>
<option selected>请选择信箱</option>
<option value="163.com">@163.com 网易</option>
<option value="sina.com">@sina.com 新浪</option>
<option value="cn.yahoo.com">@yahoo.com.cn 雅虎</option>
<option value="sohu.com">@sohu.com 搜狐</option>
</select>
<br>
密码
<input tabIndex=3 type=password size=12
name=pass>
<input tabIndex=4 type=submit value=登录
name=Submit2 onclick=setTimeout('clearpass()',1000)>
</div></td>
</form>
</tr>
</table></td>
</tr>
</table>



失败作品
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><DIV><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#004E98"> <span class="style44"> <span class="STYLE1"><a href="http://mail.cncwing.com" target="_blank" class="style31">邮箱登陆</a></span></span> <span class="STYLE1"><a href="http://www.hao123.com/mail.htm" target="_blank" class="style44 style31">申请邮箱</a></span></td>
</tr>
<tr>
<td height="70"><table width=100% border=0 cellPadding=0 cellSpacing=0
bgcolor=#F0F7FF valign=top>
<tr>
<form name=loginmail onsubmit="return chkinput2(this);" action=http://www.hao123.com/sendmail.php method=post>
<td align=center background><div align="center" class="style47 STYLE1">用户名:
<input tabIndex=1 size=14 name=user>
<br>
<select
tabIndex=2 name=site>
<option selected>请选择信箱</option>
<option value="163.com">@163.com 网易</option>
<option value="sina.com">@sina.com 新浪</option>
<option value="cn.yahoo.com">@yahoo.com.cn 雅虎</option>
<option value="sohu.com">@sohu.com 搜狐</option>
</select>
<br>
密码
<input tabIndex=3 type=password size=12
name=pass>
<script language="javascript">
function openwin() {
var newwin=window.open("","newwin","top=0,left=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=790,height=530");
document.form1.action="/";
document.form1.submit();
return true;}
</script>
<FORM method=post name=form1 target="newwin">
<input type="button" tabIndex=4 value=登录
name=Submit2 onclick="openwin()">
</form>
</form>
</tr>
</table>
</table>
</td>
</tr>
</table>


生是色狼,死是色鬼。

秋冰梦

职务:普通成员
等级:6
金币:5.0
发贴:4325
#22007/7/6 15:36:16
<form name=loginmail onsubmit="return chkinput2(this);" action=http://www.hao123.com/sendmail.php method=post>

其中加入 target="_blank" 就解决了~~我同事告诉我的~~哎


生是色狼,死是色鬼。