title: Disable Dropdown Box using Javascript on condition
body: <p>I have a form in which there are a few radio buttons and a dropdown box.</p>
  
  <p><strong>What I want?</strong></p>
  
  <ol>
  <li>When I select the radio button 'Receipt' or 'Payment' the dropdown box must be active.</li>
  <li>When I select the radio button 'Other Income' or 'Other Expense', the dropdown box must be disabled.</li>
  </ol>
  
  <p>The HTML and JS I've tried is mentioned below. Any help would be appreciated.</p>
  
  <blockquote>
    <p><strong>HTML</strong></p>
  </blockquote>
  
  <pre><code>&lt;label class="radio-inline"&gt;&lt;input type="radio" name="type" id="type" value="receipt" onClick="party_check()" /&gt;Receipt&lt;/label&gt;
  
  &lt;label class="radio-inline"&gt;&lt;input type="radio" name="type" id="type" value="payment" onClick="party_check()" /&gt;Payment&lt;/label&gt;
  
  &lt;label class="radio-inline"&gt;&lt;input type="radio" name="type" id="type" value="other income" onClick="party_check()" /&gt;Other Income&lt;/label&gt;
  
  &lt;label class="radio-inline"&gt;&lt;input type="radio" name="type" id="type" value="other expense" onClick="party_check()" /&gt;Other Expense&lt;/label&gt;
  
  &lt;select name="party" id="party" class="form-control"&gt;
  &lt;option value=""&gt;Please select an option&lt;/option&gt;
  &lt;option value="1"&gt;Option 1&lt;/option&gt;
  &lt;option value="2"&gt;Option 2&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <blockquote>
    <p><strong>JS</strong></p>
  </blockquote>
  
  <pre><code>function party_check(){
      if((document.type[0].checked) || (document.type[1].checked)){
          document.getElementById("party").disabled=false;
      }
      else
      {
          document.getElementById("party").disabled=true;
      }
  }
  </code></pre>