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

Another Multiple Question!

Status
Not open for further replies.
May 9, 2000
446
GB
Okay so i've ust been asked to change a select menu to a multiple select menu... I've put multiple in the <select> tag but now my update sql doesn't work.

I'm guessing because, for example, when the user selects two values from the list the form passes myvalue=abc&myvalue=def... can anyone show me how to get round this?

Cheers
 
when you request the element the values will be returned comma delimited.. so you'll need to split them out and then apply the values towards your sql statement.

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
 
Code:
dim arrayObj
dim arrayValue

arrayObj = Split(Request.Form("myvalue"))

FOR EACH arrayValue IN arrayObj
  UPDATE Database SET myfield = '" & arrayValue & "'"
NEXT

The UPDATE statement is just an example.

ToddWW
 
See my post at the end of your other thread for a quick and easy way of doing your SQL IN command with your list.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top