Disabling the radio button with jQuery
<p>I have a group of radio buttons with same <code>name</code> and some of which may be disabled. I don't want the user to check or uncheck the disabled radio buttons . Obviously this means that if the checked radio button in the group is disabled the user cannot change the selection.</p>

<p>i wrote the following code for this.</p>

<pre><code>$("#container").delegate(":radio","click",function(e){
    alert($(":radio").filter(":checked").val());
    //this always shows up the value of the radio button clicked
    if($(":radio").filter(":checked").is(":disabled"))
    {
        e.preventDefault();
    }

});
</code></pre>

<p>I suppose the problem is that as soon as the radio button is clicked the selection changes and the event handler is executed and <code>.preventDefault()</code> reverts the selection.</p>

<p>I hope it's clear</p>

<p>Here is a <a href="http://jsfiddle.net/dTBVa/3/" rel="nofollow">jsFiddle</a></p>
