Social Icons

Pages

Monday, May 27, 2013

Ajax SubmitButton Yii

  1. <?php echo CHtml::ajaxSubmitButton( 'Send',
  2.                                         CHtml::normalizeUrl(array('site/ajaxIndexSubmit')),
  3.                                         array(
  4.                                         'error'=>'js:function(){
  5.                                             alert('error');
  6.                                         }',
  7.                                         'beforeSend'=>'js:function(){
  8.                                             alert('beforeSend');
  9.                                         }',
  10.                                         'success'=>'js:function(data){
  11.                                             alert('success, data from server: '+data);
  12.                                         }',
  13.                                         'complete'=>'js:function(){
  14.                                             alert('complete');
  15.                                         }',
  16.                                         //'update'=>'#where_to_put_the_response',
  17.                                         )
  18.                                     );
  19.     ?>

No comments:

Post a Comment