• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

Have menu/list selection remain "persistent"

Using ASP vbscript...I have a page that returns results from a database where the results are filtered via a drop down list within a form. I would like that selection to remain after the user submits. Is there a way to do this?
0
MilburnDrysdale
Asked:
MilburnDrysdale
  • 3
  • 2
1 Solution
 
peterxlaneCommented:
Is your dropdown list created from a database or is it hardcoded?
0
 
reiss20Commented:
Hi MilburnDrysdale ,

Not too sure what you mean by "selection to remain after the user submits". Presumably when they submit the form it will post the details to another page. Could you explain a bit further?

Thanks,

Reiss :o)
0
 
MilburnDrysdaleAuthor Commented:
peterxlane - the list is static...

reiss20 - the dropdown list merely filters records for the existing page, so it reloads the same page (not a jump menu).
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
peterxlaneCommented:
Here is one concept:

<form method="post">
<select name="myfilter">
<%
strFilterVal = Request.Form("myfilter")
If Request.Form <> "" Then
%>
      <option value="<%=strFilterVal%>"><%=strFilterVal%></option>
<%
End If
%>
      <option value="one">one</option>
      <option value="two">two</option>
      <option value="three">three</option>
</select>
<input type="submit">
</form>

<br /><br />
<%
If Request.Form <> "" Then
      Response.Write "option selected: " & strFilterVal
End If
%>
0
 
peterxlaneCommented:
and here is another approach:

<%
strFilterVal = Request.Form("myfilter")
%>

<form method="post">
<select name="myfilter">
      <option value="one"<%If strFilterVal = "one" Then Response.Write " selected"%>>one</option>
      <option value="two"<%If strFilterVal = "two" Then Response.Write " selected"%>>two</option>
      <option value="three"<%If strFilterVal = "three" Then Response.Write " selected"%>>three</option>
</select>
<input type="submit">
</form>
0
 
MilburnDrysdaleAuthor Commented:
peterxlane - sorry for the delay...this was what I needed. Thanks!
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now