function checkbox() { // no semicolon here
var checkCount=0;
var alder = document.nameOfForm.alder;
for (var i=0; i<alder.length;i++) {
if (alder[i].checked) checkCount+=1; // add one
}
if (checkCount != 1) {
alert('Checka 1 och bare 1');
return false;
}
return true;
}
However depending on where you call this, you might want to UNCHECK the one you checked too many