vishnu saini
vishnu saini

Reputation: 66

asp classic and select tag with multiple attribute

I am using select tag of html and having multiple attribute. and now I am fetching of selected option from the select tag using asp classic. but getting 500 internal server error.

<%
response.write(request("evtCategory").Count)
response.write(request("evtCategory"))
%>

<form id="frmSearch" method="post" >
<select name="evtCategory" multiple>
    <option value="0">--Select Category--</option>
    <option value="1">First</option>
    <option value="2">Second</option>
    <option value="3">Third</option>
    <option value="4">Fourth</option>
    <option value="5">Fifth</option>
</select>

<input type="submit" value="Search" />
</form>

Upvotes: 2

Views: 5227

Answers (1)

johna
johna

Reputation: 10772

I don't think Count exists in Classic ASP, that looks like ASP.NET code.

Multiple selected values will be returned as a comma separated string.

You can use Split to get the selected values as an array.

Dim values, i
values = Split(Request.Form("evtCategory"), ",")
For i = 0 To UBound(values)
    Response.Write("Value " & i & " = " & values(i) & "<br />")
Next

Upvotes: 2

Related Questions