Click to See Complete Forum and Search --> : How i can pass mutiple selected value of a dropdown to the next page


dev.amit
02-02-2006, 09:53 AM
Hello friends
i have a dropdown list
I am able to select multiple from the list unable to pass the multiple values to the next page
i can pass if i am choosing singel value
How i can do it
If u can help i would be greatful to u?
Thanks
Love
Amit

schizo
02-02-2006, 12:32 PM
Make sure you put brackets on the end of your select tag's name. Then you can access those values as an array on the posted page.

<select name="test[]" ...

theDIABLA
02-03-2006, 01:04 AM
Konnichiwa... I am also working on a drop down list where it lists out the table names & when I click on the "Submit" button, the selected table will be displayed. I have no clue as to why my table cannot be displayed. There was no error though. Could you please help me out?

<!-- **********************************************
* Drop down list for listing of table names *
********************************************** // -->

<%@ Language="VBScript" %>

<%
// Open DB
Set dataBase = Server.CreateObject("ADODB.Connection")
dataBase.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=C:\Inetpub\wwwroot\PROJECT\Jul05.mdb"

If Request.Form("submit") = "View" Then

myTable = Request.Form("tables")
SQL = "SELECT * FROM " & myTable
dataBase.Open

// Response.Write (" & myTable & ")
end if


%>

<html>
<head>
<title>Listing of table names</title>
</head>

<body bgcolor="white" text="black">

<form action="" method="post">
<!-- **************************************************************************************************** ******************** //-->
<select name="tables">

<option value="Consolidatedblacklist">ConsolidatedBlacklist</option>
<option value="consolidatedinvalidcard">ConsolidatedinvalidCard</option>

</select>

<input type="submit" value="View" name=submit>
</form>
</body>
</html>

dev.amit
02-28-2006, 03:55 AM
Just add the multiple word in the select satement and the size u want to display on the secreen
It is as simple as u see it
If u want to queary the multiple value selected then u have to use IN statement in ur queary
<!-- **********************************************
* Drop down list for listing of table names *
********************************************** // -->

<%@ Language="VBScript" %>

<%
// Open DB
Set dataBase = Server.CreateObject("ADODB.Connection")
dataBase.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=C:\Inetpub\wwwroot\PROJECT\Jul05.mdb"

If Request.Form("submit") = "View" Then

myTable = Request.Form("tables")
SQL = "SELECT * FROM " & myTable
dataBase.Open

// Response.Write (" & myTable & ")
end if


%>

<html>
<head>
<title>Listing of table names</title>
</head>

<body bgcolor="white" text="black">

<form action="" method="post">
<!-- **************************************************************************************************** ******************** //-->
<select name="tables" multiple size="2">

<option value="Consolidatedblacklist">ConsolidatedBlacklist</option>
<option value="consolidatedinvalidcard">ConsolidatedinvalidCard</option>

</select>

<input type="submit" value="View" name=submit>
</form>
</body>
</html>