<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
$(function() {
var lastChecked = [];
$(':checkbox').change(function() {
if (this.checked) {
if (lastChecked.length && this.value != lastChecked[0].value) { $(this).prop("checked", false)
alert("the last box you checked has a different value");
}
lastChecked.unshift(this);
}
else {
lastChecked.splice(lastChecked.indexOf(this), 1);
}
});
});
</script>
</head>
<body>
1
<input type="checkbox" name="checkbox[]" onClick="getVal();setChecks(this)" value="1" class="chk" id="chk<?php echo $a++?>" title="<?php echo $rspatient['first'],' ',$rspatient['frameman'],' ', $rspatient['framemodel']?>" lang="<?php echo $rspatient['name']?>"/><br/>
2
<input type="checkbox" name="checkbox[]" onClick="getVal();setChecks(this)" value="2" class="chk" id="chk<?php echo $a++?>" title="<?php echo $rspatient['first'],' ',$rspatient['frameman'],' ', $rspatient['framemodel']?>" lang="<?php echo $rspatient['name']?>"/><br/>
3
<input type="checkbox" name="checkbox[]" onClick="getVal();setChecks(this)" value="3" class="chk" id="chk<?php echo $a++?>" title="<?php echo $rspatient['first'],' ',$rspatient['frameman'],' ', $rspatient['framemodel']?>" lang="<?php echo $rspatient['name']?>"/><br/>
1
<input type="checkbox" name="checkbox[]" onClick="getVal();setChecks(this)" value="1" class="chk" id="chk<?php echo $a++?>" title="<?php echo $rspatient['first'],' ',$rspatient['frameman'],' ', $rspatient['framemodel']?>" lang="<?php echo $rspatient['name']?>"/><br/>
2
<input type="checkbox" name="checkbox[]" onClick="getVal();setChecks(this)" value="2" class="chk" id="chk<?php echo $a++?>" title="<?php echo $rspatient['first'],' ',$rspatient['frameman'],' ', $rspatient['framemodel']?>" lang="<?php echo $rspatient['name']?>"/><br/>
3
<input type="checkbox" name="checkbox[]" onClick="getVal();setChecks(this)" value="3" class="chk" id="chk<?php echo $a++?>" title="<?php echo $rspatient['first'],' ',$rspatient['frameman'],' ', $rspatient['framemodel']?>" lang="<?php echo $rspatient['name']?>"/><br/>
1
<input type="checkbox" name="checkbox[]" onClick="getVal();setChecks(this)" value="1" class="chk" id="chk<?php echo $a++?>" title="<?php echo $rspatient['first'],' ',$rspatient['frameman'],' ', $rspatient['framemodel']?>" lang="<?php echo $rspatient['name']?>"/><br/>
2
<input type="checkbox" name="checkbox[]" onClick="getVal();setChecks(this)" value="2" class="chk" id="chk<?php echo $a++?>" title="<?php echo $rspatient['first'],' ',$rspatient['frameman'],' ', $rspatient['framemodel']?>" lang="<?php echo $rspatient['name']?>"/><br/>
3
<input type="checkbox" name="checkbox[]" onClick="getVal();setChecks(this)" value="3" class="chk" id="chk<?php echo $a++?>" title="<?php echo $rspatient['first'],' ',$rspatient['frameman'],' ', $rspatient['framemodel']?>" lang="<?php echo $rspatient['name']?>"/><br/>
</body>
</html>