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

Clear listbox

Status
Not open for further replies.

karenmierkalns

Programmer
May 10, 2001
54
CA
I'm new with ASP, so bear with me.

As the page loads, I have a listbox populating with ASP. Then when another listbox is changed, I want to use its value in an sql statement, which I want to use to re-populate the original listbox.

Should I be using VBScript to make this second part happen, or can I use ASP? As I understand it, ASP won't happen until I hit submit, correct?

Should I be using VBScript event handlers?..if so, is there an easy solution? - ie. should I be clearing the listbox, then repopulating it? If so, how is that done with VBScript? I would prefer it if I could use ASP.

Thanks, - Karen
 
Hmmmm.

OK, I think there must be better ways, but this is what I would do (and have seen done):

When the value of the first listbox changes, redirect the page to itself, but this time, include the value of the first listbox as a querystring.

example:

when the page loads, it's url looks like this:

page.asp

check the values of all the possible querystrings you might pass into it. in other words, check the value of request.querystring("listbox1")


If it's "" then populate as normal, else, use it in the sql query to populate listbox 2.

Sheez. What a mess. Hope you could make sense of this. _________________
Bixarrio

e = m * (c ^ 2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top