That's more complicated, one of the radio buttons will have to be of different name than B & C. You'd need to use javascript for this.
This is the javascript. Insert this wherever in the HTML you want.
Code:
<script type="text/javascript">
function chkState() {
var a = document.getElementById('a');
var b = document.getElementById('b');
var c = document.getElementById('c');
if(a.checked = true) {
b.checked = false;
c.checked = false;
}
if(b.checked = true) {
a.checked = false;
}
if(c.checked = true) {
a.checked = false;
}
}
</script>
This is a sample while statement. Include the echo in your while statement.
PHP Code:
while($this => $that) { // sample while statement
echo '
<input type="checkbox" name="a" value="a" id="a" checked="checked"><label for="a">A</label>
<input type="checkbox" name="b" value="b" id="b"><label for="b">B</label>
<input type="checkbox" name="c" value="c" id="c"><label for="c">C</label>
';
} // end while statement
For each value in while that occurs, the checkboxes will be repeated. When {a} is checked, {b} and {c} will be unchecked. When {b} or {c} are checked, {a} will be unchecked.
HTH
Bookmarks