ASP
--
Questions
--
Followers
Top Experts
Writing a form in ASP, and I need to have a single drop down in it.
However, I need to pass multiple values with it.
It posts to a mail page.
For example, the user select Option A from the drop down example below:
<select size="1" name="DropDown">
<option ValueA="1" ValueB="2" ValueC="3">A</option>
<option>B</option>
</select>
What I need to get in my mail script is:
<input type="hidden" name="ValueA" value="<%= request.form("DropDown") %>">
<input type="hidden" name="ValueB" value="<%= request.form("DropDown") %>">
<input type="hidden" name="ValueC" value="<%= request.form("DropDown") %>">
Is there any way to go about doing this?
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
<input type="hidden" name="ValueA" value="<%=split(Request.Fo
<input type="hidden" name="ValueB" value="<%=split(Request.Fo
<input type="hidden" name="ValueC" value="<%=split(Request.Fo
%>
<select size="1" name="DropDown">
<option value="1|2|3">A</option>
<option value="1|4|6">B</option>
</select>
<%dim arr_dropdown
arr_dropdown = split(Request.Form("DropDo
if isarray(arr_dropdown) then
%><input type="hidden" name="ValueA" value="<%= arr_dropdown(0)%>">
<input type="hidden" name="ValueB" value="<%= arr_dropdown(1)%>">
<input type="hidden" name="ValueC" value="<%= arr_dropdown(2)%>">
<%else
'chuck a poo
end if%>
<select size="1" name="DropDown">
<option Value="1:2:3">A</option>
<option>B</option>
</select>
then use something like this in the next page..
<%
dim myvar
dim a
dim b
dim c
myvar=split(request.form("
a=myvar(0)
b=myvar(1)
c=myvar(2)
and
<input type="hidden" name="ValueA" value="<%=(a)%>">
<input type="hidden" name="ValueB" value="<%=(b)%>">
<input type="hidden" name="ValueC" value="<%=(c)%>">
%>
Mattis






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
replace split(Request.Form("DropDo
split(Request.Form("DropDo
Thanks again!
The current setup gives me this error:
Microsoft VBScript runtime error '800a0009'
Subscript out of range: '[number: 0]'
/configframe.asp, line 58
This is line 58:
<input type="hidden" name="Price" value="<%=arr_dropdown(0)%
Can anyone locate my problem ? (The dropdown box shows up fine above the error message)
<body>
<form method="GET" action="shopcart.asp" target="_self">
<select name="Dropdown">"
<%
strDSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/database/
Set myCon = Server.CreateObject("ADODB
myCon.Open strDSN
Varenr = request.querystring("varen
SQL = "SELECT (SELECT pris FROM produkter where config.varenr=produkter.va
Set rs = mycon.Execute(SQL)
If not (rs.BOF or rs.EOF) Then
Response.Write "Pris før ændringer: Kr. " & rs("prispc")*1.25 & ",00" & " ( " & FormatNumber(rs("prispc"),
Response.Write "Kabinet" & "<BR>"
response.write "<option selected>Vælg</option>"
Do while not rs.EOF
prispc=rs("prispc")*1.25
Prismoms = FormatNumber(((rs("priskab
Prismomsex = FormatNumber(rs("priskabin
kabinet = rs("kabinet")
varenrkabinet = rs("Varenrkabinet")
%>
<option value="1|2|3"><%=rs("kabin
<%
rs.movenext
loop
Else
Response.write "No upgrades available."
End if
%>
<%
dim arr_dropdown
arr_dropdown = split(Request.Form("Dropdo
if isarray(arr_dropdown) then
%>
<input type="hidden" name="Price" value="<%=arr_dropdown(0)%
<input type="hidden" name="ProductID" value="<%=arr_dropdown(1)%
<input type="hidden" name="ProductName" value="<%=arr_dropdown(2)%
<input type="hidden" name="Quantity" value="1">
<input type="hidden" name="Action" value="AddItem">
<input type="submit" value="Send"><input type="reset" value="Nulstil" name="B2">
<%
else
'chuck a wobbly
end if
%>
</select>
</form>
</body>

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Response.write "("
Response.write Request.Form("Dropdown")
Response.write ")"
and we'll see what that outputs.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Infoframe.asp which shows a specific product, in this case a computer sends varenr (it's ProductID) to configframe.asp. Configframe.asp looks in the database for the upgrade options on this varenr (ProductID) and lists the products in a dropdown box.
Now, in infoframe.asp it is easy to send the values Quantity, Price, ProductID and ProductName to shopcart.asp because there are only one product.
My problem:
In configframe.asp there are several products listet in the dropdown box and the right values need to be sent for the selected product. And I am trying to get a SEND-button, not an onchange thing.
Shopcart.asp receives like this:
<%
If Action="AddItem" then
ProductID=Request.QueryStr
ProductName=Request.QueryS
Quantity=Request.QueryStri
Price=Request.QueryString(
...
From your page names I assume you're using a frameset to place them all?
When posting the dropdown data, do you:
1) Have the dropdown within the <form></form> tags of the form being posted?
2) Have something in the form like
target="target_frame" ?
ASP
--
Questions
--
Followers
Top Experts
Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.