Toggling a disabled radio button and changing checked value
<p>I'm running jQuery script to disable a radio button when a select from a dropdown is chosen. At the same time, I'm asking the other radio button to become checked.</p>

<p>The disable and re-enable works fine, however the checked attribute only works the first time. And only on the first radio.</p>

<p>Here is the js code:</p>

<pre><code>$(document).ready(function () {
// disable the no end date radio button if the selection is changed to lifetime:
        $("#budget_type").change(function () {
            if ($(this).val() === "lifetime_budget") {
                $('#schedule_no_end').attr("disabled", true);
                $('#run_on_schedule').attr("disabled", false);

                $('.schedule_end_radio').attr('checked',true);
            } else {

                $('#run_on_schedule').attr("disabled", true);
                $('#schedule_no_end').attr("disabled", false);

                $('.run_always').attr('checked',true);

            }
        });

    });
});
</code></pre>

<p>and the HTML:</p>

<pre><code>Budget: &lt;select id="budget_type" name="budget_type"&gt;
    &lt;option value="daily_budget"&gt;Daily budget&lt;/option&gt;
    &lt;option value="lifetime_budget"&gt;Lifetime budget&lt;/option&gt;
&lt;/select&gt;
Schedule End: &lt;label&gt;No End Date&lt;input checked name="schedule_end" id="schedule_no_end" value="ongoing"
                                       type="radio"&gt;&lt;/label&gt;&lt;br&gt;
&lt;label&gt;End on:&lt;input name="schedule_end" id="schedule_end_radio" class="schedule_end_radio" value="endondate" type="radio"&gt;&lt;/label&gt;
&lt;input class="datetimepicker" name="end_date" type="text"&gt;&lt;br&gt;&lt;br&gt;

Advert Scheduling: &lt;label&gt;Run adverts all the time&lt;input checked name="advert_scheduling" id="run_always" class="run_always" value="allthetime"
                                                         type="radio"&gt;&lt;/label&gt;
&lt;label&gt;Run adverts on schedule&lt;input name="advert_scheduling" id="run_on_schedule"  value="onschedule" type="radio" disabled&gt;&lt;/label&gt;
</code></pre>