need help requesting an array

Results 1 to 5 of 5

Thread: need help requesting an array

  1. #1
    mark Guest

    Default need help requesting an array

    I have a array of checkboxes being named dynamically from the database. when I submit it via querystring to the next page, I can see which checkboxes were clicked, but I cant seem to write them to the page or do anything else with them. bill wilkinson on this board once told me you would have problems using checkboxes, but I want to confirm what he said. if it isnt going to work then Ill ditch it, otherwise, I would like to program this the way it should be. <BR><BR>my code looks like this so far:<BR><BR><BR> While Not RS.EOF<BR> i = rs("id") &#039; this just being the number associated to the app in the database<BR> Response.Write "&#060;tr&#062;&#060;td&#062;&#060;input type=checkbox name=apps"&i&"&#062;&#060;/td&#062;"<BR> For j = 1 to RS.Fields.Count - 3<BR> Response.Write "&#060;td&#062;" & RS(i) & "&#060;/td&#062;"<BR> <BR> Next<BR> Response.Write "&#060;/tr&#062;"<BR><BR> &#039;move to the next record<BR> RS.MoveNext<BR> WEND<BR><BR>Next page looks something like this:<BR><BR>Dim appsRows( ) <BR>ReDim appsRows( ) <BR>For i = 1 To Ubound(appsRows)<BR> appsRows( i ) = Request.form("apps" & i) <BR>Next <BR><BR>If this code looks like Im a little lost, its cause I am :) thanks for any help. I just want this array to be displayed on the page.. from there I can split it up and send it to the db.

  2. #2
    Keith M Guest

    Default RE: need help requesting an array

    You could loop through the Request.Form object and check there...<BR>say you have 10 checkboxes...<BR><BR>Dim arrayCheckBoxes(10),intTotal<BR>intTotal = 0<BR>For each item in Request.Form<BR> If Left(item,4)="apps" Then<BR> &#039; Assume checkboxes are named appsX, where X=integer<BR> &#039; and NOTHING else starts with apps<BR> arrayCheckBoxes(intTotal) = Request.Form(item)<BR> intTotal = intTotal + 1<BR> End If<BR>Next<BR>ReDim Preserve arrayCheckBoxes(intTotal)<BR><BR><BR>or something along those lines... this should give you an array with all the checkboxes that were checked.

  3. #3
    Join Date
    Dec 1969

    Default RE: need help requesting an array

  4. #4
    mark Guest

    Default RE: need help requesting an array

    I tried incorporating your code... and I keep getting a "This array is fixed or temporarily locked " error. do you know why this is? thanks for your help by the way, I see the logic there

  5. #5
    Keith M Guest

    Default RE: need help requesting an array

    Change:<BR><BR>Dim arrayCheckBoxes(10),intTotal <BR><BR>To:<BR><BR>ReDim arrayCheckBoxes(10)<BR>Dim intTotal

Posting Permissions

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