Reading in multiple checkboxes

Results 1 to 2 of 2

Thread: Reading in multiple checkboxes

  1. #1
    Lemar Guest

    Default Reading in multiple checkboxes

    How do I retrieve the values of multiple checkboxes on a submitted form? Following all directions I can find, I keep getting a 405 error (Request Line Method not supported) or something like that. Followed example from actineserverpages.com/learn/formcheckbox.asp

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Reading in multiple checkboxes

    Create all the checkboxes with the same name but with unique values:<BR><BR>&#060;INPUT TYPE=CHECKBOX NAME=SomeIdenticalName VALUE=Checkbox1&#062;<BR>&#060;INPUT TYPE=CHECKBOX NAME=SomeIdenticalName VALUE=Checkbox2&#062;<BR>&#060;INPUT TYPE=CHECKBOX NAME=SomeIdenticalName VALUE=Checkbox3&#062;<BR>&#060;INPUT TYPE=CHECKBOX NAME=SomeIdenticalName VALUE=Checkbox4&#062;<BR><BR>Then, in your ASP page that the form submits to, read in Request("SomeIdenticalName") into a string. Then use split to create an array.<BR><BR>&#060;%<BR>Dim str<BR>str = Request("SomeIdenticalName")<BR><BR>Dim myArray<BR>myArray = split(str, ",")<BR><BR>Dim iLoop<BR>For iLoop = LBound(myArray) to UBound(myArray)<BR>Response.Write Trim(myArray(iLoop))<BR>Next<BR>%&#062;<BR><BR>Hap py Programming! :)

Posting Permissions

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