passing values using arrays when a checkbox is clicked

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • meenu_susi
    New Member
    • Jun 2006
    • 47

    passing values using arrays when a checkbox is clicked

    i have a doubt regarding arrays in asp.... in a page i am displaying the
    following fields.. shirtname,quant ity, size of shirt, price.... and for each row
    i have a checkbox... when i click that check box that particular row has to get
    selected... and i want to pass the value to next page.. for example... poloshirt ,
    2 ,xl, 250 -- here i have check box when i click this the shirtname, 2,xl ,250 has to
    get passed to next page... how to do this....can anybody help..
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    The data should automatically be passed to the next page when you submit the form.

    Comment

    • meenu_susi
      New Member
      • Jun 2006
      • 47

      #3
      thanks for ur reply
      can u tell me in somewhat details..
      to use arrays to pass the values

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        Unfortunately I am not an ASP expert, in fact I know nothing about ASP but you could try looking at

        W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

        Comment

        • sashi
          Recognized Expert Top Contributor
          • Jun 2006
          • 1749

          #5
          hi meenu,

          i would suggest using session variable or quesrystring to pass variable among pages.. i.e.

          on your 1st page (.html /.asp)
          Code:
          <a href="./report.asp?page_no=1&item_no=2&item_color=3">Item Name</a>
          on your second page (.asp)
          Code:
          <%
          Dim nPageNo, nItemColor, strItemColor
          
          nPageNo     = Request.QueryString{"page_no")
          nItemColor   =Request.QueryString{"item_no")
          strItemColor = Request.QueryString{"item_color")
          
          %>
          Last edited by sashi; Jun 28 '06, 03:22 AM.

          Comment

          • meenu_susi
            New Member
            • Jun 2006
            • 47

            #6
            thanks fr ur reply...sashi
            i know the method of passing through querystring..
            but this may not possible in this case...
            because i have a amny checkbox and when i click a particular checkbox that
            row has to get selected...

            shirt=request.f orm("s")
            size=request.fo rm("sz")
            <input type="checkbox" name="sname" value="" >

            where in var shirt the name of the shirt will be stored
            where in size the size will get stored
            when i click the checkbox above...these two values have to get posted

            Comment

            • sashi
              Recognized Expert Top Contributor
              • Jun 2006
              • 1749

              #7
              Hi Meenu,

              emm.. let me see.. ok am sure each record must have a unique id.. rite?? am talking abt the primary key.. now assign that key to the value attribute ot the checkbox.. ok..

              for further reading pls check the links below.. good luck my fren..

              W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.



              Founded in 1999, ASPFree.com offers free gift cards, game redeem codes, and daily giveaways with no fees or hidden charges. Get your favorite freebies and surprises every day.
              Last edited by sashi; Jun 29 '06, 08:33 AM.

              Comment

              • meenu_susi
                New Member
                • Jun 2006
                • 47

                #8
                ok i will see to that
                thanks a lot

                regards
                meenu
                Last edited by meenu_susi; Jun 30 '06, 10:31 AM.

                Comment

                Working...