I am trying to make an order form using asp/vbscript that will get the values of multiple HTML select menus at one button click, and then pass that all of the information to another asp page which will do the processing and deal with the database stuff. my problem is that i am unable to retrieve each value from the select menus, instead i only get 0 the default value. does anyone know how i can accomplish this? my original idea was to just put all values in an array and pass that to another page which will deal with each item.
i have pasted my code bellow.
THanks!
Code:
if not rs.bof or not rs.eof then
do while not rs.eof
thisformlet = ""
dim thepic
thepic =rs("picture")
cstr(thepic)
if cat = rs("type")then
%>
<form name="order1" method="post" action="default5.asp" >
<tr align="center">
<td width="25%" ><a class="thumbnail" href="#thumb"><%=rs("formnum")%><span><img src=<%response.Write(thepic)%> border="0" /></span></a></td>
<td width="25%"><%=rs("Description")%></td>
<td width="25%"><%=rs("Packs Of")%></td>
<td width="25%" valign="middle">
<select name="qty<%response.Write(count)%>">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</td>
</tr>
<%
rs.movenext
else
cat = rs("type")
newcat = 1
if newcat = 1 then%> <!--a new catagory is discovered-->
<tr><td align="left" bgcolor="#808080" colspan="4" height="30px"> <font color="ffffff" style="font-size:12pt"><b>
<%
response.Write(cat) %></b></font></td> </tr> <%
newcat = 0
end if
%>
<tr align="center">
<td width="25%" ><a class="thumbnail" href="#thumb"><%=rs("formnum")%><span><img src=<%response.Write(thepic)%> border="0" /></span></a></td>
<td width="25%"><%=rs("Description")%></td>
<td width="25%"><%=rs("Packs Of")%></td>
<td width="25%" valign="middle">
<select name="qty<%response.Write(count)%>">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</td>
</tr>
<%
rs.movenext
end if
count = count + 1 ' gives all qty boxes unique names
loop
else
response.Write("<tr align=""center""><td colspan=""8"">There are currently no forms available to order.</td></tr>")
end if
rs.close()
set rs = nothing
%>
</td></tr>
<!-- content ends here -->
</td>
</td>
</tr></table>
<br />
<input type="button" name="order1" value="Order!" onClick="">
</form>
<%
dim totalsize
totalsize= count
count = 0
for count= 0 to totalsize
qtyname = "qty" & count
response.Write(qtyname)
request.Form(qtyname)
If qtyname<>"" Then
response.Write("the item is be written")
count
End If
count = count+ 1
next