Passing text box value to sub?

S

Sean Cassidy

Hi,
I'm trying to have a user enter the quantity he wants to order in the
text box and pass all the parameters to a sub called "add" on the same page.
I can't figure out how to pass the quantity entered to the sub. Can someone
help?
Thanks,
SC

Response.Write "<center><table border=""1""><tr>"
For i= 0 to RS.Fields.Count - 1
Response.Write "<th>" & RS(i).Name & "</th>"
Next
Response.Write "</tr>"
While Not RS.EOF
Response.Write "<tr>"
For i= 0 to RS.Fields.Count - 1
Response.Write "<td>" & RS(i) & "</td>"
Next
Response.Write "<td>"%><Input type="text" size="1" name="MEQTY"
value="0"></td><%
Response.Write "<td>"%><A
HREF="./thispage.asp?action=add&qty=?????&stockid=<%=RS.fields("Stock_ID")%>
&description=<%=RS.fields("description")%>">Order!</A></td><%
0011-00-030 THE SCIENCE OF HURDLING BOOKS 39 Order!
 
T

thorpe

where is the sub?

passing values to subs is easy:

<%
mystring = "boo"
sub testsub(var)
response.write(var)
end sub
call testsub(mystring)
%>

will produce:

boo
 
P

Patrice

I would rather POST the form so that you can read the value using
Request.Form. Here you could read the value using JavaScript
(MyForm.MyField.value) so that you can pass this on the querystring (also
submitting a form with the GET Method will pas all field values on the
QueryString automatically).

Patrice
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,268
Messages
2,571,096
Members
48,773
Latest member
Kaybee

Latest Threads

Top