Passing text box value to sub?

Discussion in 'ASP General' started by Sean Cassidy, Aug 17, 2004.

  1. Sean Cassidy

    Sean Cassidy Guest

    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!
    Sean Cassidy, Aug 17, 2004
    #1
    1. Advertising

  2. Sean Cassidy

    thorpe Guest

    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.fields("Stock_ID")%>
    > &description=<%=RS.fields("description")%>">Order!</A></td><%
    > 0011-00-030 THE SCIENCE OF HURDLING BOOKS 39 Order!
    >
    >
    thorpe, Aug 17, 2004
    #2
    1. Advertising

  3. Sean Cassidy

    Patrice Guest

    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.fields("Stock_ID")%>
    > &description=<%=RS.fields("description")%>">Order!</A></td><%
    > 0011-00-030 THE SCIENCE OF HURDLING BOOKS 39 Order!
    >
    >
    Patrice, Aug 17, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gnarlodious
    Replies:
    4
    Views:
    17,566
    elizas
    May 5, 2010
  2. loga123
    Replies:
    2
    Views:
    321
    loga123
    May 20, 2006
  3. =?Utf-8?B?Um95?=

    Passing value of a text box in a href tag

    =?Utf-8?B?Um95?=, Feb 6, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,693
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
    Feb 6, 2007
  4. Ben
    Replies:
    2
    Views:
    867
  5. Lawrence D'Oliveiro

    Death To Sub-Sub-Sub-Directories!

    Lawrence D'Oliveiro, May 5, 2011, in forum: Java
    Replies:
    92
    Views:
    1,980
    Lawrence D'Oliveiro
    May 20, 2011
Loading...

Share This Page