submitting a few checkboxes together

Results 1 to 4 of 4

Thread: submitting a few checkboxes together

  1. #1
    Join Date
    Dec 1969

    Default submitting a few checkboxes together

    Hi, I want to create a form that will contain a list of people that will have a check box next to their name. I want the script to handle the checked names, the user can check more than one checkbox, meaning I need to create the checkboxes as an array, how do I do it in ASP? (in PHP I add "[ ]" to the name of the checkbox)<BR><BR>Thanks,<BR>David.

  2. #2
    lawra Guest

    Default RE: submitting a few checkboxes together

    this is what i do in this case :<BR><BR>in the form<BR><BR>&#060;input type="checkbox" name="pname" value="ref_name1"&#062;Name1<BR>&#060;input type="checkbox" name="pname" value="ref_name2"&#062;Name2<BR>&#060;input type="checkbox" name="pname" value="ref_name2"&#062;Name2<BR><BR><BR><BR>in the asp script<BR><BR>for i=1 to request("pname").count<BR><BR><BR>my_var = request("pname")(i)<BR><BR>my_script<BR><BR>next<B R><BR><BR>only the checked name are handled.<BR><BR>

  3. #3
    Mike B Guest

    Default RE: submitting a few checkboxes together

    I used this code and it works great, however, I don&#039t understand why when I do IsArray(request("pname")) it returns false?<BR><BR>Mike Burgess<BR>

  4. #4
    Mike Burgess Guest

    Default RE: submitting a few checkboxes together

    Sorry . . . lets try that again . . .<BR><BR>Collecting a set of form checksboxes as an array (all have the name "pname" and accessing that data within an asp script using:<BR><BR>for i = 1 to request("pname").count<BR> myVar = request("pname")(i)<BR> ...<BR>next<BR><BR>This works great. What I don&#039t understand is that if I test to see if request("pname") is an array using IsArray(request("pname")), it returns false.<BR><BR>Any ideas why?<BR>Mike Burgess<BR>

Posting Permissions

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