title: yii controller action won't fire from form
body: <p>I'm trying get a simple ajax call working with yii, not using the native yii means.  My goal is to populate  state and city fields on input from a zip code field, using a db look up in the create action. I have a separate javascript file,
  <code></p>
  
  <pre><code>    $('#Accounts_zip').bind('focusout',function(){     
      $.ajax({
          type: 'POST',
            url:'/gatesadmin/index.php?r=Accounts/Ziplookup',
            data: {zip:$('#Accounts_zip').val()},
            success:  function(datain, textStatus, jqXHR) {alert(datain.statecode);} ,
            error: function(jqxhr, textStatus, errorthrown){alert(errorthrown);},
            dataType:JSON
         });
      alert($('#Accounts_zip').val());
      });
  </code></pre>
  
  <p>and in my AccountsController I have:
  <code></p>
  
  <pre>public function actionZiplookup()
  {
      $z = new ZipDao();
      $row = $z-&gt;GetCityStateByZip($_REQUEST['data']);
      header('Content-Type: application/json; charset="UTF-8"');
      echo CJSON::encode(array('output'=&gt;$row));
  }
  </code></pre>
  
  <p>and my form is out of the box generated CRUD:
  </p>
  
  <pre>...
      &lt;div class="row"&gt;
      &lt;?php echo $form-&gt;labelEx($model,'zip'); ?&gt;
      &lt;?php echo $form-&gt;textField($model,'zip',array('size'=&gt;10,'maxlength'=&gt;10)); ?&gt;
      &lt;?php echo $form-&gt;error($model,'zip'); ?&gt;
  &lt;/div&gt;
  ...
  </code></pre>
  
  <p>I know the javascript is working because I get my alert, and if I call the URL directly  yii fires the actionZiplookup event because I'm getting the returned json.  I just can't seem to be able to get the form to invoke the ajax successfully because I get External Server error in the jquery ajax failure event.  I've combed through the net and the closest examples I can find embed the javascript in the form itself and use the Yii::app()-createUrl() method to define the url, but there has to be a way getting the controller action to fire while keeping javascript code in a separate file.</p>
  
  <p>Any help would be greatly appreciated.  </p>