<table> <tr> <td>Venue</td> <td><input name="Concert" id="concert" class="text" type="text" /></td> <td><input type="checkbox" name="Band1" value="BlablaBand1"></td> <td><input type="checkbox" name="Band2" value="BlablaBand2"></td> <td><input type="checkbox" name="Band3" value="BlablaBand3"></td> </tr> </table>
<table> <tr> <td>Venue</td> <td>[+Concert+]</td> <td>[+Band1+]</td> <td>[+Band2+]</td> <td>[+Band3+]</td> </tr> </table>
<input type="radio" name="Band[]" value="BlablaBand3">
-> "radioCheckboxGroup: Makes all checkboxes with the given name behave like a radio button list" http://www.texotela.co.uk/code/jquery/checkboxes//**
* Makes checkboxes behave like a radio button group
* i.e. only one can be selected at a time
*
* @name radioCheckboxGroup
* @param name field name
* @author Sam Collett (http://www.texotela.co.uk)
* @example $.radioCheckboxGroup("fieldname");
*
*/
jQuery.radioCheckboxGroup = function(name)
{
var x = jQuery("input[@name=" + name + "]");
x.click(
function()
{
// uncheck every other box with the same name
x.not(this).each(
function()
{
this.checked = false;
}
).end();
}
);
}<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
/* select first group */
$("#group-one input:checkbox").click( function () {
$("#group-one input:checkbox").removeAttr("checked");
$(this).attr("checked","checked");
});
/* select second group */
$("#group-two input:checkbox").click( function () {
$("#group-two input:checkbox").removeAttr("checked");
$(this).attr("checked","checked");
});
});
</script>
<style>
div { color:red; }
</style>
</head>
<body>
<form id="group-one">
<input type="checkbox" name="newsletter" value="Hourly" />
<input type="checkbox" name="newsletter" value="Daily" />
<input type="checkbox" name="newsletter" value="Weekly" />
<input type="checkbox" name="newsletter" value="Monthly" />
<input type="checkbox" name="newsletter" value="Yearly" />
</form>
<form id="group-two">
<input type="checkbox" name="newsletter" value="Hourly" />
<input type="checkbox" name="newsletter" value="Daily" />
<input type="checkbox" name="newsletter" value="Weekly" />
<input type="checkbox" name="newsletter" value="Monthly" />
<input type="checkbox" name="newsletter" value="Yearly" />
</form>
</body>
</html>I just want to thank you for posting the question, the possibility and the answeryou’re welcome
i needed a solution very quickly, so i was actually googeling & tweeting while i was typing my question...nonetheless i wanted to reassure, that i wouldn’t oversee an eForm solution