I am completely lost as to how I can solve this.
I need to create a matrix of radio buttons, column 1 to 3 and rows A to C.
A B C
1 (o) (o) (o)
2 (o)
I some how stumbled upon the answer while playing with it O_o
Basically you use the class name in conjunction with the name attribute to get a multi-axis radio button. Then the radio buttons are reset based on the same name and you reset the others based on class name. Elegant yet simple.
1
2
3
$("input").click(function(){
$("input."+this.className).not($(this)).each(function(){
this.checked = false;
});
});
I added another cool little feature to this with the following code
$("input").click(function(){
$("input."+this.className).not($(this)).each(function(){
this.checked = false;
});
$("input:not([name='"+this.name+"'])").each(function(){
if ($("input[name='"+this.name+"']:checked").length < 1)
if($("input."+this.className+":checked").length < 1)
this.checked = true;
});
});
This enables it to automatically change a radio button selection if another selection deselects it... maybe you should just see the demo. :P It's a little hard to explain I guess.