title: Drop-down menu based on the selection of radio button
body: <p>I have four radio buttons and I would like to get the drop-down menu based on the selected radio button. Is it best if I just write all those drop-downs ready and display them based on the selection or is there a way to do it with ajax (because the drop-down values are coming from database) ?
  Here are the radio buttons:</p>
  
  <pre><code>&lt;input type="radio" name="some" value="someValue1"&gt;
  &lt;input type="radio" name="some" value="someValue2"&gt;
  &lt;input type="radio" name="some" value="someValue3"&gt;
  &lt;input type="radio" name="some" value="someValue4"&gt;
  </code></pre>
  
  <p>Here is the drop-down:</p>
  
  <pre><code>&lt;select name="reason"&gt;
  &lt;?php
  $data = WorkReason::all();
  foreach ($data as $d) {
  ?&gt;
   &lt;option value="&lt;?php echo $d-&gt;code; ?&gt;"&gt;&lt;?php echo $d-&gt;reason; ?&gt;&lt;/option&gt;
  &lt;?php
  }
  ?&gt;
  &lt;/select&gt; 
  </code></pre>
  
  <p>I am using php ActiveRecords to get the values from database.
  So if anybody knows a good way of doing this I would appreciate some help.</p>