Disable buttons within one of many forms using jQuery
<p>I have a number of forms like this:</p>

<pre><code>&lt;form class="some-name"&gt;
    &lt;input type="hidden" name="bill" value"flower" /&gt;
    &lt;button value="0"&gt;Yes&lt;/button&gt;
    &lt;button value="1"&gt;No&lt;/button&gt;
    &lt;button value="2"&gt;No&lt;/button&gt;
&lt;/form&gt;

&lt;form class="some-name"&gt;
    &lt;input type="hidden" name="ben" value"men" /&gt;
    &lt;button value="0"&gt;Yes&lt;/button&gt;
    &lt;button value="1"&gt;No&lt;/button&gt;
    &lt;button value="2"&gt;No&lt;/button&gt;
&lt;/form&gt;
</code></pre>

<p><strong>What I want to happen</strong></p>

<p>When a user clicks a button, I want to disable the other buttons within that form.</p>

<p>Currently I'm trying with this jQuery, but it's not working? </p>

<p>My thinking behind it is the current element is a button so you want it's parent which is the form and then all the buttons in the form?</p>

<pre><code>$(document).on("click", ".some-name button", function(){
    $($(this)).parent().$("button").attr("disabled", true);
});
</code></pre>

<p>also tried:</p>

<pre><code>$(document).on("click", ".some-name button", function(){
    $($(this)).parent("button").attr("disabled", true);
});
</code></pre>

<p>but no luck with either?</p>
