Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Passing text box value to sub?

Reply
Thread Tools

Passing text box value to sub?

 
 
Sean Cassidy
Guest
Posts: n/a
 
      08-17-2004
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.fi elds("Stock_ID")%>
&description=<%=RS.fields("description")%>">Order! </A></td><%
0011-00-030 THE SCIENCE OF HURDLING BOOKS 39 Order!


 
Reply With Quote
 
 
 
 
thorpe
Guest
Posts: n/a
 
      08-17-2004
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


"Sean Cassidy" <> wrote in message
news:...
> 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.fi elds("Stock_ID")%>
> &description=<%=RS.fields("description")%>">Order! </A></td><%
> 0011-00-030 THE SCIENCE OF HURDLING BOOKS 39 Order!
>
>



 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      08-17-2004
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


--

"Sean Cassidy" <> a écrit dans le message de
news:...
> 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.fi elds("Stock_ID")%>
> &description=<%=RS.fields("description")%>">Order! </A></td><%
> 0011-00-030 THE SCIENCE OF HURDLING BOOKS 39 Order!
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
div box questions; float text around a box, fit box to image size Gnarlodious HTML 4 05-05-2010 11:30 AM
text box value does not match value on postback allan.palmer@cit.com ASP .Net 2 12-21-2007 07:03 PM
Passing value of a text box in a href tag =?Utf-8?B?Um95?= ASP .Net 2 02-06-2007 04:03 PM
Linking a text box and/or a list box to an Access table's column. ryan.d.rembaum@kp.org ASP .Net 1 08-05-2005 04:17 AM
Text box losing most recent Text value Ken McCrory ASP .Net 5 03-10-2005 05:32 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57