从一个页面链接到另一个经典ASP的下拉菜单选择值

Link from one page to choose value in dropdown on another classic ASP

本文关键字:ASP 经典 另一个 下拉菜单 选择 链接 一个      更新时间:2023-09-26

我试图在一个旧ASP网站的一个页面上获得一些链接,重定向到一个联系表单,然后根据从页面点击之前的链接选择下拉列表中的值。

因此,如果用户选择Send InquiryAgent P,我希望联系人表单的下拉值为Agent P,然后他们可以填写表单的其余部分,并在提交时将发送电子邮件给Agent P(电子邮件部分已经设置)。

<div class="agentProfile">
<img src="images/agents/Agent-P.jpg" alt="Agent P" width="125" height="141" />
<h2>Agent P</h2>
<h3>Platypus</h3>
<ul class="contactList floatLeft">
<li class="mobile">xxx-xxx-xxxx</li>
<li class="email"><a href="hidden mailto link"></a></li>
<li class="email"><a href="/contact2.asp">Send Inquiry</a></li>
</ul>
<a href="agent_p.asp" class="profileBtn">View Profile</a>
</div>

该代码将把查询发送到联系表单。我不确定我是否应该在链接上有一个锚标记或其他东西,将访问者发送到联系表单,或者这应该如何工作。

<tr>
    <td class="tdainfo"><strong>What agent would you like to send this to?</strong></td>
    <td><select name="agent" id="agent" class="inputselect">
    <option value="">Please Select</option>
    <option value="Agent P">Agent P</option>
    <option value="Agent Z">Agent Z</option>
    </select></td>
</tr>

有人能帮帮我吗?我假设我将需要Javascript这样的动作,但我甚至不接近Javascript的专家,所以我迷路了。

步骤1。当链接被点击时,告诉contact2.asp选择了哪个代理。

<li class="email"><a href="/contact2.asp?agent=AgentP">Send Inquiry</a></li>

步骤2。在contact2.asp中,在

下拉菜单中预先选择所选代理。
<select name="agent" id="agent" class="inputselect">
<option value="">Please Select</option>
<option value="Agent P"<% 
  If Request.QueryString("agent") = "AgentP" Then Response.Write(" selected")
%>>Agent P</option>
<option value="Agent Z"<% 
  If Request.QueryString("agent") = "AgentZ" Then Response.Write(" selected")
%>>Agent Z</option>
</select>