Results 1 to 7 of 7

Thread: Checkboxes

  1. #1
    Dragos B. Guest

    Default Checkboxes

    How can I display more than one checked checkboxes? What I don't know is how can I know if that checkbox is checked?

  2. #2
    wiley Guest

    Default RE: Checkboxes

    In psuedo code:<BR><BR>checkbox = "Anything" &#039;give the checkbox a value<BR>if Request.Form("checkbox") = "Anything" Then<BR> do some code<BR>else<BR> do some code if checkbox value is &#060;&#062; to "Anything"<BR>end if<BR><BR>hope that helps

  3. #3
    Dragos B. Guest

    Default RE: Checkboxes

    Thanks for answer, but I know how can I take a single checkbox value. What I don&#039;t know is how can I capture values from more than one checkboxes. No matter if there are just 2 or 50.

  4. #4
    wiley Guest

    Default RE: Checkboxes

    not sure what your asking. 2 to 50 what? 2 to 50 checkboxes or 2 checkboxes checked out of 50. If your check boxes are on a form I think no matter what you have to check each individual value for each checkbox. You might be able to do a For Each statement as long as all the values for the checkboxes are the same i.e "ON" or "Checked" but I&#039;m not sure. I&#039;ve never had to do it. I always check each value one at a time. Sorry I couldn&#039;t help.<BR>Good Luck

  5. #5
    Dragos B. Guest

    Default RE: Checkboxes

    I know I have to do a "For Each", but what should I "Request" from Form? The checkboxes are noted "category_1 ... _50". The numbers are from a database id field.

  6. #6
    Join Date
    Dec 1969

    Default RE: Checkboxes

    if you have the checkboxes named as<BR>category_1, category_2 and so on...<BR>then to retrieve their values, run a for loop<BR><BR>for i=1 to 50<BR>str="category_"&i<BR>cat_value=request.form( str)<BR>&#039;then do whatever you want with it<BR>next<BR><BR>this will give you all the values.<BR><BR>another way you could do this is name all the checkboxes the same name, say checkbox_value, but give them separate values.<BR>then when you do <BR><BR>chk_value=request.form("checkbox_value") , <BR><BR>then the values of all the checkboxes that have been checked will be retrieved separated by a comma.<BR>so if you checked the 1,5 and the sixth checkbox, then chk_value will be something like "value1,value5,value6"<BR>

  7. #7
    Dragos B. Guest

    Default RE: Checkboxes

    Thanks. Your examples worked. But how can I create a Session for every checkbox selected in order to call in another page?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts