Select only one checkbox for product pairings x 3
<p>I am displaying products from my Product database in a table, with a checkbox to select the product that is desired.</p>

<p>Each product has 3 variants or price point options, entered in the database as seperate items for each price point variation.</p>

<pre><code>Code    category Description            Points                Choose your Points
1001-B  Logo    artwork supplied    Basic                 4.00 points
1001-S  Logo    artwork supplied    Standard          6.00 points
1001-P  Logo    artwork supplied    Premium               12.00 points
1002-B  Logo    re-draw to vector   Basic                 6.00 points
1002-S  Logo    re-draw to vector   Standard          8.00 points
1002-P  Logo    re-draw to vector   Premium              14.00 points
</code></pre>

<p>There are 3 price point variations for every product: Basic, Standard and Premium. Each "Product" has the same Product Code. So as above Product: 1001-B is the Basic, 1001-S is the standard and 1001-P is the premium.</p>

<p>So the customer chooses which Price point option they want by selecting the checkbox next to each item.</p>

<p>I am wanting to only allow them to select one price point / product for each product pairing (ie only one of the 3 price points).</p>

<p>So basically to get the checkbox to work like a radio button. I cannot use a radio button because I am using the same name for all of the items in my checkbox array: name="id[]"</p>

<pre><code>echo '&lt;input type="checkbox" name="id[]" value="' . $id . '" /&gt;&lt;/td&gt;';
</code></pre>

<p>How can I achieve this?</p>

<p>I know I can do the following:</p>

<pre><code>&lt;input type="checkbox" class="radio" value="1" name="fooby[1][]" /&gt;
&lt;input type="checkbox" class="radio" value="1" name="fooby[1][]" /&gt;
&lt;input type="checkbox" class="radio" value="1" name="fooby[1][]" /&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;input type="checkbox" class="radio" value="1" name="fooby[2][]" /&gt;
&lt;input type="checkbox" class="radio" value="1" name="fooby[2][]" /&gt;
&lt;input type="checkbox" class="radio" value="1" name="fooby[2][]" /&gt;


$("input:checkbox").click(function() {
    if ($(this).attr("checked") === true) {
        var group = "input:checkbox[name='" + $(this).attr("name") + "']";
        $(group).attr("checked", false);
        $(this).attr("checked", true);
    } else {
        $(this).attr("checked", false);
    }
});
</code></pre>

<p>But this relies on the fact that name="fooby[1][] name="fooby[2][] etc changes. I cannot do that in my case.</p>

<p>Any ideas? </p>

<p>I have already got the cart aspect of this after the page is submitted resolved so I don't want to make fundamental changes to the checkbox format I have.</p>
