faqts : Computers : Programming : Languages : Asp : ASP/VBScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

22 of 42 people (52%) answered Yes
Recently 3 of 10 people (30%) answered Yes

Entry

How can I submit a multi-select box to a processing page that updates a database?

Jul 8th, 2003 03:40
Marco de Groot, Piet Funn,


[HTML]
<select name="test" muliple>
  <option value="1">value 1</option>
  <option value="2">value 2</option>
  <option value="3">value 3</option>
  <option value="4">value 4</option>
</select>
[asp]:print
<%
For Each item In Request.Form("test")
  Response.Write item & "<BR>"
Next
%>
[asp]:datbase
<%
query = "SELECT * FROM testdb.testtable WHERE test IN ("
For i = 1 To Request.Form("test").Count
  query = query& "'" & Request.Form("test")(i) & "'"
  If i <> Request.Form("test").Count Then query= query & ","
Next
query = query & ")"
%>



© 1999-2004 Synop Pty Ltd