Enable input based on corresponding radio button
<p>I have a form with multiple options for Amounts to be sent to CC processing.  I'd like the user to select the type of payment which then activates the amount input fields.  I'm attempting to do this by setting the id of the radio button to correspond to the amount input field.  How can I enable the input Amount field based on the radio button selected?</p>

<p>HTML</p>

<pre><code>&lt;input name="doantion-type" id="general" type="radio" value="General" /&gt;
&lt;input name="doantion-type" id="occasion" type="radio" value="Occasion" /&gt;
&lt;input name="doantion-type" id="building" type="radio" value="Building" /&gt;
&lt;input name="doantion-type" id="program" type="radio" value="Program" /&gt;

&lt;input id="general" autocomplete="off" class="input required" type="text" size="30" name="Amount"&gt;

&lt;input id="occasion" autocomplete="off" class="input required" type="text" size="30" name="Amount"&gt;
&lt;input id="building" type="hidden" value="1000" name="Amount"&gt;
&lt;input id="program" type="hidden" value="180" name="Amount"&gt;
</code></pre>

<p>jQuery </p>

<pre><code>$("input[name=Amount]").prop('disabled', true);

$('input[name=doantion-type]:radio').click(function() {
var selectedDonation = '#' + $(this).attr('id');
//alert(selectedDonation);
$(selectedDonation).prop('disabled', false);

});
</code></pre>
