Yii Framework Forum: How to use ajaxSubmitButton - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to use ajaxSubmitButton Rate Topic: -----

#1 User is offline   holala 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 74
  • Joined: 23-December 09

Posted 28 April 2010 - 08:28 AM

I want use ajaxSubmitButton submit form and alert the return,there is my code:

View
<?php echo CHtml::ajaxSubmitButton('Publish',array('Post/publishAjax'),array('success'=>'js:alert('aaa')')); ?>


Controller
public function actionPublishAjax() {
echo 'sss';
}


how can i get controller action return show in the popup message box?

thank you very much!
0

#2 User is offline   ngleich 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 16-April 09

Posted 28 April 2010 - 11:39 AM

Hi, you can do it this way,

<?php echo CHtml::ajaxSubmitButton('Publish',array('Post/publishAjax'),
       array('success'=>'function(html) { alert(html); }')); ?>

1

#3 User is offline   holala 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 74
  • Joined: 23-December 09

Posted 29 April 2010 - 05:50 AM

View Postngleich, on 28 April 2010 - 11:39 AM, said:

Hi, you can do it this way,

<?php echo CHtml::ajaxSubmitButton('Publish',array('Post/publishAjax'),
       array('success'=>'function(html) { alert(html); }')); ?>




Thank you !
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users