title: Fire off alerts on button click
body: <p>When I click the button, alerts aren't performed. What am I doing wrong? Maybe I need to include some js files in my header section?</p>
  
  <p>Here is my login form view:</p>
  
  <pre><code>&lt;?php echo CHtml::beginForm(); ?&gt;
  
  &lt;div class="row"&gt;
  &lt;?php echo CHtml::label('username', 'username'); ?&gt;
  &lt;?php echo CHtml::textField('username'); ?&gt;
  &lt;/div&gt;
  &lt;div class="row"&gt;
  &lt;?php echo CHtml::label('password', 'password'); ?&gt;
  &lt;?php echo CHtml::textField('password'); ?&gt;
  &lt;/div&gt;
  &lt;?php
  echo CHtml::ajaxButton('sign in', array('site/login'),array(
          'type'=&gt;'POST',
          'update'=&gt;'#mydiv',
          'beforeSend' =&gt; 'function(){
              alert("beforeSend");
          }',
          'complete' =&gt; 'function(){
              alert("complete");
              }',
  
  ));
  ?&gt;
  &lt;?php echo CHtml::endForm(); ?&gt;
  &lt;div id="mydiv" style="color:white;"&gt;...&lt;/div&gt;
  </code></pre>
  
  <p>Here is my code in the controller:</p>
  
  <pre><code>public function actionLogin()
  {
      $this-&gt;renderPartial('//blocks/user_info');
  }
  </code></pre>
  
  <p>user_info just echoes <code>some text</code></p>