looping through checkboxes

Results 1 to 2 of 2

Thread: looping through checkboxes

  1. #1
    Join Date
    Dec 1969

    Default looping through checkboxes

    Hi everyone,<BR> I&#039;m using ASP / VBScript and want to loop through a<BR>dynamic number of checkboxes and recognise whether or not each one is<BR>checked. Note Well: each checkbox is named the same thing. I just can&#039;t<BR>think how to do it, ultimately this will enable me to insert a seperate<BR>record for each checkbox that is selected using the one form.<BR><BR><BR>Thanks for any advice<BR>Fruddy

  2. #2
    Join Date
    Dec 1969

    Default no asp...

    you gotta do that on the client side<BR><BR>var maxLength = theForm.ckboxName.length;<BR>for (var i = 0; i &#060; maxLength; i++) {<BR>if (eval("document.formName.ckbox[" + i + "].checked") == true) {<BR> total += 1;<BR> }<BR>}<BR>if (total &#060; maxLength)<BR> alert(&#039;Hmmm... looks like you forgot something&#039;)

Posting Permissions

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