Requesting only the checked checkboxes on resulting page?

Results 1 to 3 of 3

Thread: Requesting only the checked checkboxes on resulting page?

  1. #1
    Kenneth -DZ- Silver Guest

    Default Requesting only the checked checkboxes on resulting page?

    I populate a recordset of only the "goodies" from an Access db.<BR>A table lists them all with a checkbox first, then a description of the goody, then it&#039s cost.<BR>The user checks which goodies they want, and then submit the form.<BR>The resulting page shows only the goodies that were checked off with their description and cost. I&#039ve tried everything. Do Until, For Each Next, etc. What do i use for the checkbox name and value on the preceding page? exactly how do i request the checked items on the next page and also show the descrip and cost?<BR>clueless, -dz<BR>please mailto:DZ@LINE9.com Thanx! :-)<BR>

  2. #2
    Kenneth -DZ- Silver Guest

    Default RE: Requesting only the checked checkboxes on resulting page?

    Oh yeah, sorry bout this, but do i need a name AND a value assigned to each checkbox on the preceding page? Should all the names of the checkboxes be the same? Should all the values be the same, or are the values even required at all? i.e:<BR>&#060;input type=checkbox name="myGoody" value="&#060;%=rs("goody")&#037;&#062;"><BR>or...< BR>&#060;input type=checkbox name="myGoody"><BR><BR>HUGE thanx! -dz<BR>LINE9.com<BR>

  3. #3
    David Morgan Guest

    Default RE: Requesting only the checked checkboxes on resulting page?

    Common one this one...<BR><BR>There are two ways, (at least), of doing this.<BR><BR>1) Call all your checkboxes the same name and set their values to be the ID column of your table in Access.<BR><BR>&#060;%Do While Not rsGoodies.EOF&#037;&#062;<BR> &#060;input type="checkbox" name="whatGoodies" value="&#060;%=rsGoodies("GoodyID")&#037;&#062;">& #060;%=rsGoody("GoodyDescrioption")&#037;&#062; etc..<BR>&#060;% rsGoodies.MoveNext<BR>Loop&#037;&#062;<BR><BR>This will give you Request.Form("whatGoodies")(n) for each one the selected. So you could do something like this:<BR><BR>Request.Form("whatGoodies").Count = Number of checked boxes, then <BR>For i = 0 To Request.Form("whatGoodies").Count -1<BR> do something with Request.Form("whatGoodies")(i) here<BR>Next<BR><BR>Another approach would be to give the checkboxes different names.<BR><BR>You could do something like this<BR><BR>&#060;% Do While Not rsGoodies.EOF &#037;&#062;<BR>&#060;input type="checkbox" name="goody_&#060;%=rsGoodies("GoodyID")&#037;&#06 2;" value="on">&#060;%=rsGoodies("GoodyDescription")&# 037;&#062;<BR>&#060;% rsGoodies.MoveNext<BR>Loop&#037;&#062;<BR><BR>Then you would have to check for Request.Form("goody_i") where i is the ID of the record from your table.<BR><BR>Hope this helps<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
  •