会点JavaScript的都要进来, 关于Form提交的问题,
我有个企业邮局.但每次在WEB登录时都要输入 用户@域名.com 全称,大家用不惯, 我现在想用JavaScript+ASP来完成,用户只要输入用户名和密码就可以了.后面的 "@域名.com"是取自IE地址栏.这个功能可以完成了.得出的是username@domain.com
但如何把输入的用户名+@+与取自IE地址栏的域名,在用户看不出的情况下发送到第二个Form 就是邮局真正的登录介面的框里啊?? 这个我就不会了.要在同一个页面啊.不能分成二个以上的,不然就没有意义了.
下面是我的email.asp代码:
<html>
<script language="javascript">
function GetHostName()
{//构造参数对象并初始化
var name,i;
var str=location.href;//获得浏览器地址栏URL串
var num=str.indexOf("://");
str=str.substr(num+3);//截取“://”后面的参数串
num=str.indexOf("/");
if(num>0)
{
name = str.substring(0,num);
}
else
{
name = str;
}
num = name.indexOf("mail.");
if(num >= 0)
{
name = name.substring(num + 5);
}
else
{
//name = "";
}
document.form2.domain.value = name;
return name;
}
</script>
<head>
<title>集团邮局</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"; charset="gb2312">
<link href="\css\cm25.css" rel="stylesheet" type="text/css">
<style>
body,td{font-size:9pt}
</STYLE>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" onload="GetHostName()">
<form name="form2" method="post" action="email.asp">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<table width="750" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="25"></td>
<td valign="top">用户名:</td>
<td valign="top">
<input name="user" type="text" class="input01" size="15">
</td>
<td valign="top"><font size="5">@ </font> </td>
<td valign="top">
<input name="domain" type="text" class="input01" size="15">
</td>
<td></td>
</tr>
</table>
<table width="750" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="25" width="223"></td>
<td width="78" valign="top">密码:</td>
<td width="170" valign="top">
<input type="password" NAME="passwd" size="22" class="input01">
</td>
<td width="279"></td>
</tr>
</table>
<table width="750" border="0" cellpadding="0" cellspacing="0">
<tr>
<input type=image src="/images/button_74.gif" name="enter" width="71" height="25" border="0" id="enter">
</tr>
</table>
</table>
</form>
<%
user=request("user")
E="@"
domain=request("domain")
passwd=request("passwd")
userid=user&e&domain '组装成username@domain.com字符串
%>
下面是进入邮局的登录介面
<html><body>
<FORM NAME="logon" METHOD="POST" ACTION="http://mail.6655.cn:8383/login.cgi">
<INPUT TYPE="hidden" NAME="page" VALUE="login">
<tbody>
<tr>
<TD ALIGN="right" width="96">用户名: </TD>
<TD WIDTH="226">
<INPUT class=textbox TYPE="text" SIZE="19" NAME="userid" value=<%response.write user%>>
</TD></tr>
<tr>
<TD ALIGN="right">密码:</TD>
<TD>
<INPUT class=textbox TYPE="password" maxlength=32 SIZE="19" NAME="passwd">
</TD></tr>
<TR>
<TD> </TD>
<TD> <INPUT src="images/input.gif" type=image onClick="return formSubmit(this.form);">
</td></tr>
</FORM>
</body></html>
提供邮箱测试帐号test@6655.cn 密码:test
请大家多多帮忙.谢谢!!