[英]Link from one page to choose value in dropdown on another classic ASP
我正在尝试在旧的ASP网站的一页上获得一些链接,以重定向到联系表单,然后该表单将根据之前在页面中单击的链接,在下拉列表中选择值。
因此,如果用户选择“ Send Inquiry
到Agent 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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.