如何将文本值传递给“a href”

时间:2010-09-27 06:00:12

标签: authentication asp-classic

我需要你帮助我使用asp代码。 我有一个包含用户名和密码的主页,供用户使用 a href 属性登录,我不知道如何将文本值传递给< strong> a href 到 login.asp文件。 请帮帮我!

示例:

<table>
    <tr>
       <td>User</td>
<td><input type="text" id="user"/></td>
</tr>
    <tr>
       <td>Password</td>
       <td><input type="password" id="pass"/></td>
    </tr>
    <tr>
       <td><a href="login.asp?user=?????????????">Log in</a></td>
    </tr>
</table>

1 个答案:

答案 0 :(得分:0)

首先,用户名和密码文本框必须位于表单元素

e.g。

<form name="myForm" id="myForm" method="post" action="login.asp">
 <input type="text" name="username"/>
 <input type="password" name="password"/>
 <a href="#" onclick="document.myForm.submit()">Login</a>
</form>

在您的.asp页面中,您可以获取值

Request.Form("username")
Request.Form("password")
相关问题