Checkboxes array

Discussion in 'C#' started by cancer10, Oct 18, 2006.

  1. #1
    I have the following table in page1.asp

    
    <table>
    <tr>
    <td><input type="checkbox" name=chk value=1></td>
    </tr>
    
    <tr>
    <td><input type="checkbox" name=chk value=2></td>
    </tr>
    
    
    <tr>
    <td><input type="checkbox" name=chk value=3></td>
    </tr>
    
    </table>
    Code (markup):

    If I want to retrieve the value of all the checkboxes which I have selected in page1.asp and display them in another page, page2.asp then I write the code as below

    
    for each cid in request.Form("chk")
    response.Write cid 
    next
    Code (markup):

    Now if I select 2 checkboxes (2 and 3) then the result will show like 23


    but I want them in seperate variables, how can I?


    Thanx for your help
     
    cancer10, Oct 18, 2006 IP
  2. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #2
    name them differently like checkbox1 and then checkbox2 etc
     
    ludwig, Oct 20, 2006 IP