<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
    <title>Untitled</title>
    <script language="JavaScript" type="text/javascript">
    <!--
    var g_intChecked = 0;
    function init()
    {
        var arrElements = document.forms['frm'].elements;
        for( i = 0; i < arrElements.length; i++ )
        {
            if( arrElements[ i ].type == "checkbox" )
            {
                if( arrElements[ i ].checked )
                {
                    g_intChecked++;
                }
            }
        }
        document.getElementById( 'spnTotal' ).innerText = g_intChecked;
    }
    function vipcount( objElement )
    {
        ( objElement.checked ) ? g_intChecked++ : g_intChecked--;
        document.getElementById( 'spnTotal' ).innerText = g_intChecked;
    }
    //-->
    </script>
</head>
<body onload="init();">
<form id="frm">
<INPUT type="checkbox" id="personid1" name="personid1" value="" onclick="vipcount( this );"><br>
<INPUT type="checkbox" id="personid2" name="personid2" value="" onclick="vipcount( this );"><br>
<INPUT type="checkbox" id="personid3" name="personid3" value="" onclick="vipcount( this );"><br>
<INPUT type="checkbox" id="personid4" name="personid4" value="" onclick="vipcount( this );"><br>
<INPUT type="checkbox" id="personid5" name="personid5" value="" onclick="vipcount( this );"><br>
<INPUT type="checkbox" id="personid6" name="personid6" value="" onclick="vipcount( this );">
</form>
antal valgte: <span id="spnTotal"></span>
</body>
</html>