This solution uses IE interpretation of screen co-ordinates.
There are many choises
1) a table of checkboxes.
Another way is to use images or some other elements to show the boxes and hidden checkboxes to register the selections. Javascript is needed to change the status of the checkboxes. Below the checkboxes are visible.
The above uses the following javascript function:
function valitse(obj) { if (obj.style.color=="black") { obj.style.color="red"; cbid='c'+obj.id; cb= document.getElementById(cbid); cb.checked=true; } else { obj.style.color="black"; cbid='c'+obj.id; cb= document.getElementById(cbid); cb.checked=false; } return;
To check the number of selection we need a counter that should be tested before registering a selection. For example:
counter=0; function valitse(obj) { if (obj.style.color=="black") { if (counter==7) alert('No more selections!); obj.style.color="red"; counter++; cbid='c'+obj.id; cb= document.getElementById(cbid); cb.checked=true; } else { obj.style.color="black"; counter--; cbid='c'+obj.id; cb= document.getElementById(cbid); cb.checked=false; } return;