title: Show/hide a div in Yii radio button click
body: <p>Iam trying to show/hide a div based on the radio button click in Yii form. But the onclick event is not working for me. Please help me to fix this as Iam a new bee to Yii.
  Iam using this code for radio button</p>
  
  <pre><code> &lt;?php echo $form-&gt;radioButtonList($model,'service_type',array(
                      '0'=&gt;'Yes',
                      '1'=&gt;'No',
                      'separator'=&gt;'',
                      'onclick'=&gt;"setVisible('Yes_box',true);setVisible('No_box', false)"));     ?&gt;
  
    &lt;div id="Yes_box" style="visibility: hidden"&gt; contents of Yes type &lt;/div&gt;
     &lt;div id="No_box" style="visibility: hidden"&gt; contents of No type &lt;/div&gt;
  </code></pre>
  
  <p>This is my script:</p>
  
  <pre><code>&lt;script&gt;
    $(document).ready(function () {
      $("input[name$='type']").click(function () {
        var value = $(this).val();
        if (value == 'Yes') {
          $("#Yes_box").show();
          $("#No_box").hide();
        } else if (value == 'No') {
          $("#No_box").show();
          $("#Yes_box").hide();
        }
      });
      $("#Yes_box").show();
      $("#No_box").hide();
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>When Iam using this code only the last condition is working i.e, Yes_box is showing. I think the onclick value is not passing here. Please help me to recover this problem. </p>