Print Page | Close Window

I need help, with maintaining the selected name in

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=23712
Printed Date: 29 March 2026 at 5:17am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: I need help, with maintaining the selected name in
Posted By: Bebopgeo
Subject: I need help, with maintaining the selected name in
Date Posted: 10 July 2007 at 8:25pm
I need help, with maintaining the selected name in a jump menu. I have a jump menu with four names in it. and when I select a name in the jump menu, I have it going back to the same page, and I would like it to maintain, the selected name that I have selected.



Replies:
Posted By: KCWebMonkey
Date Posted: 11 July 2007 at 6:00pm
easiest way is to add a name/value pair on to the querystring when the form submits...
 
mypage.asp?selectedItem=2
 
and then you can read the name/value pair from the URL, save it as a variable, and dynamically select the item based on the variable value.


Posted By: Bebopgeo
Date Posted: 13 July 2007 at 6:23pm
Well I,m a beginner, and I didn't get it yet. So more detail would be go. Here is what I got so far. Form1 is a jump menu that does not have a Request.QueryString attach to it and From2 has a Request.QueryString attach to it at the Dynamic source "<%= Request.QueryString("Countryname2") %>" The jump menus are on "Test Jump page.asp". all the names in the dropdown list go back to the same page. I can see the name and value in the URL at the top of the page. But I can't figure out how to get that to influence the name in the dropdown list.
 
<body>
 
<form action="" name="form1" id="form1">
  <select name="Countryname1" id="Countryname1" onchange="MM_jumpMenu('parent',this,0)">
    <option value="Test Jump.asp?Test1=1" selected="selected">Test1</option>
    <option value="Test Jump.asp?Test2=2">Test2</option>
    <option value="Test Jump.asp?Test3=3">Test3</option>
    <option value="Test Jump.asp?Test4=4">Test4</option>
  </select>
</form>
 
<form name="form2" id="form2">
  <select name="Countryname2" id="Countryname2" onchange="MM_jumpMenu('parent',this,0)">
    <option value="Test Jump.asp?Test5=5" <%If (Not isNull(Request.QueryString("Countryname2"))) Then If ("Test Jump.asp?Test5=5" = CStr(Request.QueryString("Countryname2"))) Then Response.Write("selected=""selected""") : Response.Write("")%>>Test5</option>
    <option value="Test Jump.asp?Test6=6" <%If (Not isNull(Request.QueryString("Countryname2"))) Then If ("Test Jump.asp?Test6=6" = CStr(Request.QueryString("Countryname2"))) Then Response.Write("selected=""selected""") : Response.Write("")%>>Test6</option>
    <option value="Test Jump.asp?Test7=7" <%If (Not isNull(Request.QueryString("Countryname2"))) Then If ("Test Jump.asp?Test7=7" = CStr(Request.QueryString("Countryname2"))) Then Response.Write("selected=""selected""") : Response.Write("")%>>Test7</option>
    <option value="Test Jump.asp?Test8=8" <%If (Not isNull(Request.QueryString("Countryname2"))) Then If ("Test Jump.asp?Test8=8" = CStr(Request.QueryString("Countryname2"))) Then Response.Write("selected=""selected""") : Response.Write("")%>>Test8</option>
  </select>
</form>

</body>
</html>


Posted By: Bebopgeo
Date Posted: 27 July 2007 at 7:04pm
Here it is and it works
<select name="Countryname2" id="Countryname2" onchange="MM_jumpMenu('parent',this,0)">
<option value="Test Jump.asp?link=1" <%If (Not isNull(Request.QueryString("link"))) Then If ("1" = CStr(Request.QueryString("link"))) Then Response.Write("selected=""selected""") : Response.Write("")%>>Test5</option>
<option value="Test Jump.asp?link=2" <%If (Not isNull(Request.QueryString("link"))) Then If ("2" = CStr(Request.QueryString("link"))) Then Response.Write("selected=""selected""") : Response.Write("")%>>Test6</option>



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net