CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2012
    Posts
    1

    How to count checkboxes in a form

    Hello everyone,
    I am by no means a programmer and need some help solving a problem I have been having. I created a form on my website, and I would like for it to count the number of checkboxes a user selects. browed some forums and other websites to find a solution; however, when I insert the code, it doesn't seem to work. Maybe I'm putting it in the wrong place? This is the code to my form. Can someone please edit it so that it will count the selected checkboxes? That way, I can just easily insert it back into my website.I would really appreciate any help or advice

    YOU SUBMIT YOUR PICKS, MAKE SURE YOU ONLY CHECKED 10 BOXES!
    </font> </p>
    <table width="100%" border="0" cellspacing="0" cellpadding="10">
    <tr align="left" valign="top">
    <td width="19%" class="style13"><font size="3" color="#FFFFFF">Alias:</font></td>
    <td width="32%" class="style13">
    <font size="4">
    &nbsp;<!--webbot bot="Validation" s-validation-constraint="Greater than or equal to" s-validation-value="&quot; &quot;" --><input type="text" Name="Alias" size="45">
    </font>
    </td>
    <td width="19%" class="style13"><font size="3" color="#FFFFFF">Email Address:</font></td>
    <td width="30%" class="style13">
    <font size="4">
    &nbsp;<!--webbot bot="Validation" s-validation-constraint="Greater than or equal to" s-validation-value="&quot; &quot;" --><input name="Email" type="text" id="email" size="45">
    </font>
    </td>
    </tr>
    <tr align="left" valign="top">
    <td class="style13"><font size="3" color="#FFFFFF">Pick 1 Winner:</font></td>
    <td class="style13">
    <font size="4">
    <select name="Winner" size="1" id="Winne_ Pool">
    <option>None</option>
    <option>Arizona</option>
    <option>Baltimore</option>
    <option>Atlanta</option>
    <option>Buffalo</option>
    <option>Carolina</option>
    <option>Chicago</option>
    <option>Cincinnati</option>
    <option>Cleveland</option>
    <option>Dallas</option>
    <option>Denver</option>
    <option>Detroit</option>
    <option>Green Bay</option>
    <option>Houston</option>
    <option>Indianapolis</option>
    <option>Jacksonville</option>
    <option>Kansas City</option>
    <option>Miami</option>
    <option>Minnesota</option>
    <option>New England</option>
    <option>New Orleans</option>
    <option>New York Giants</option>
    <option>New York Jets</option>
    <option>Oakland</option>
    <option>Philadelphia</option>
    <option>Pittsburgh</option>
    <option>San Diego</option>
    <option>San Francisco</option>
    <option>Seattle</option>
    <option>St. Louis</option>
    <option>Tampa Bay</option>
    <option>Tennessee</option>
    <option>Washington</option>
    </select>
    &nbsp;</font></td>
    <td class="style13"><font size="3" color="#FFFFFF">Pick 1 Loser:</font></td>
    <td class="style13">
    <font size="4">
    <select name="Loser" size="1" id="Loser_Pool">
    <option>None</option>
    <option>Arizona</option>
    <option>Baltimore</option>
    <option>Atlanta</option>
    <option>Buffalo</option>
    <option>Carolina</option>
    <option>Chicago</option>
    <option>Cincinnati</option>
    <option>Cleveland</option>
    <option>Dallas</option>
    <option>Denver</option>
    <option>Detroit</option>
    <option>Green Bay</option>
    <option>Houston</option>
    <option>Indianapolis</option>
    <option>Jacksonville</option>
    <option>Kansas City</option>
    <option>Miami</option>
    <option>Minnesota</option>
    <option>New England</option>
    <option>New Orleans</option>
    <option>New York Giants</option>
    <option>New York Jets</option>
    <option>Oakland</option>
    <option>Philadelphia</option>
    <option>Pittsburgh</option>
    <option>San Diego</option>
    <option>San Francisco</option>
    <option>Seattle</option>
    <option>St. Louis</option>
    <option>Tampa Bay</option>
    <option>Tennessee</option>
    <option>Washington</option>
    </select>
    </font>
    </td>
    </tr>
    </table>
    <p align="center" class="style13"><font size="3" color="#FFFFFF">Comments/Questions? Let me know!</font></p>
    <p align="center">
    <textarea name="message" cols="75" rows="5" id="message"></textarea>
    </p>
    <p align="center" class="style13">
    <input type="submit" name="Submit" value="I'm Ready! Submit my choices!">
    </p>
    </form>
    <p class="style1">&nbsp; </p></td>
    </tr>

    </script>
    </table>
    </div>
    </body>
    </html>

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: How to count checkboxes in a form

    This is a Javascript question, not a Java question.
    I've asked the mods to move it to the client side scripting forum for you.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured