Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ReLoad drop down the way it origionally loaded

Status
Not open for further replies.

ralphtrent

Programmer
Jun 2, 2003
958
US
Hello
I am creating an ASP app that will load a list of users based on SQL. My goal is to select from the list and process my form and keep the user selected in the drop in its origionaly place. I am reshowing the form at the top of the page. I have it so it will show the default to the users name but still show him in the origial order. So it shows him twice. I want to only see him once, in his origional place. Any Help, please let me know.

Thanks
Ralph
 
Do While NOT objRS.EOF
Response.Write &quot;<option value=&quot;& chr(34) & objRS.Fields.Item(&quot;myfield&quot;) & chr(34)
If objRS.Fields.Item(&quot;myfield&quot;) = Request.Form(&quot;myfield&quot;) Then
Response.Write &quot; selected&quot;
End If
Response.Write &quot;>&quot;
Loop
 
No... You could do the same thing from an array or collection.
 
Ralph

Simply pass the user name/id on to the new page in a querystring.
Load the same dropdown the same way.
In the body onload event (<body onload=&quot;doLoad()&quot;) fire off the following client side vbscript:

sub doLoad()
<%if request.querystring(&quot;dropdown&quot;)<>&quot;&quot; then%>
form.myDropdown.value='<%=request.querystring(&quot;dropdown&quot;)%>'
<%end if%>
end sub

That will load your dropdown to the user you want only when there is a querystring value for dropdown. Place this code in client side script tags.

Jonathan Galpin MCSD
because software should be easy to use
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top