Yii Framework Forum: How To Define Data Option In 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 Define Data Option In Ajaxsubmitbutton Rate Topic: -----

#1 User is offline   globalnewbie 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 27-May 13

Posted 27 May 2013 - 04:34 PM

I am trying to submit a form via ajax hence I am using ajaxSubmitButton along with CActiveForm. However, I would like to pass additional data along with the submit. How do I add that. Here is what I have but doesn't work:

echo CHtml::ajaxSubmitButton('Submit', array('site/endpoint'), array('data'=>'{ajax: "endpoint-form"}'));


Thx
0

#2 User is offline   seenivasan 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 620
  • Joined: 17-June 12
  • Location:Chennai,TamilNadu,India.

Posted 27 May 2013 - 10:47 PM

Dear Friend

Welcome to YII Forum.

Things can be done in the following way.I hope some nicer things exists.

//if we take the endpoint-form as id of the form element...
echo CHtml::ajaxSubmitButton('Submit',array('site/endpoint'),array(
		
			'data'=>'js:$("#endpoint-form").serialize()+"&ajax=endpoint-form"',
		
		)); ?>


Regards.
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