Passing text box value to sub?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sean Cassidy

    Passing text box value to sub?

    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><t able border=""1""><t r>"
    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>"%><In put type="text" size="1" name="MEQTY"
    value="0"></td><%
    Response.Write "<td>"%><A
    HREF="./thispage.asp?ac tion=add&qty=?? ???&stockid=<%= RS.fields("Stoc k_ID")%>
    &description=<% =RS.fields("des cription")%>">O rder!</A></td><%
    0011-00-030 THE SCIENCE OF HURDLING BOOKS 39 Order!


  • thorpe

    #2
    Re: Passing text box value to sub?

    where is the sub?

    passing values to subs is easy:

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

    will produce:

    boo


    "Sean Cassidy" <cassidysean@ro gers.com> wrote in message
    news:udh2rnAhEH A.216@tk2msftng p13.phx.gbl...[color=blue]
    > 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[/color]
    page.[color=blue]
    > I can't figure out how to pass the quantity entered to the sub. Can[/color]
    someone[color=blue]
    > help?
    > Thanks,
    > SC
    >
    > Response.Write "<center><t able border=""1""><t r>"
    > 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>"%><In put type="text" size="1" name="MEQTY"
    > value="0"></td><%
    > Response.Write "<td>"%><A
    >[/color]
    HREF="./thispage.asp?ac tion=add&qty=?? ???&stockid=<%= RS.fields("Stoc k_ID")%>[color=blue]
    > &description=<% =RS.fields("des cription")%>">O rder!</A></td><%
    > 0011-00-030 THE SCIENCE OF HURDLING BOOKS 39 Order!
    >
    >[/color]


    Comment

    • Patrice

      #3
      Re: Passing text box value to sub?

      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" <cassidysean@ro gers.com> a écrit dans le message de
      news:udh2rnAhEH A.216@tk2msftng p13.phx.gbl...[color=blue]
      > 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[/color]
      page.[color=blue]
      > I can't figure out how to pass the quantity entered to the sub. Can[/color]
      someone[color=blue]
      > help?
      > Thanks,
      > SC
      >
      > Response.Write "<center><t able border=""1""><t r>"
      > 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>"%><In put type="text" size="1" name="MEQTY"
      > value="0"></td><%
      > Response.Write "<td>"%><A
      >[/color]
      HREF="./thispage.asp?ac tion=add&qty=?? ???&stockid=<%= RS.fields("Stoc k_ID")%>[color=blue]
      > &description=<% =RS.fields("des cription")%>">O rder!</A></td><%
      > 0011-00-030 THE SCIENCE OF HURDLING BOOKS 39 Order!
      >
      >[/color]


      Comment

      Working...