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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

classic asp - getting dropdown selection and reposting - help

Status
Not open for further replies.

RonMc

Programmer
Jul 13, 2002
3
CA
Any help appreciated on this as I'm stuck at this point after many confusing hours. This is on a complex classic asp page and I'd rather keep the changes minimal. I've had to add a drop down filter box at the top of the page, further down a recordset loops to load records. I'm looping at the top near the filter and load the filter items into a dictionary, but I have two issues that I'm just spinning my wheels on:

1. how to get the value selected out of the dropdown selector below and
2. how to pass it as a parameter back to the same page (emplist_mainten.asp)

I'm using the action=pagename in the form below, but I've tried with and without this form to no effect. The page is not reloading at this point, and when it occasionally did there was no parameter passed in chrome - but IE got the parameter until that too broke. Note that in code above this I'm looping through the recordset and stuffing the data values into a dictionary. The drop down is populating properly from the dictionary, but I'm not getting a value out of the drop down. I have not used dictionaries before and perhaps I'm not using it correctly.

<form action="emplist_mainten.asp" method="get">
<Select id="FilterDepartment" name="FilterDepartment" onchange="self.location=self.location+'?FilterDepa rtment='+FilterDepartment.options[FilterDepartment.selectedIndex].text;>

<% dim i,a,s
a=DeptDict.Items
For i = 0 To DeptDict.Count -1 %>
<option value="<%= (a(i)) %>"> <%= (a(i)) %></option>
<% Next %>
</Select>
</form>

Thanks for any suggestions!
 
Same as you would with any HTML form, the user presses the submit button your code reads the POSTED data, what your ASP code does first is check that the form HAS been submitted.


thread333-934092



Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top