How to validate check box button through javascript

Hii Everyone, I have a checkbox field having 10 options.User has to select any 3 of them.If User select more than that then error msg should thrown.And it should done through java script as the form has to run from web and m using javascript for validating all other fields.

so anybody please help me to solve this problem.please send the javascript code.

                                     saswat

Subject: How to validate check box button through javascript

Have you done a google search or checked other resources before asking for code here?

http://www.google.com/search?hl=en&q=Javascript+number+of+checkboxes+selected&spell=1