linuxdrake
(Linuxdrake)
1
apply ajax,code like this
echo CHtml::ajaxsubmitbutton(’’,
Yii::app()->createUrl(’/User/addcart’),
array(
‘data’ =>array(‘ID’=>$model->id,
‘[color="#FF0000"]qty_item_1[/color]’=>????,
‘user’=>Yii::app()->user->id),
‘type’=>‘POST’,
‘update’=>’$(#buynum).text(data)’
),
array(‘class’=>‘cartbutton’)
);
qty_item_1 is the id of input,like this
<input type="text" name="[color="#FF0000"]qty_item_1[/color]" value="1" id="qty_item_1"/>
if changed the value of the input ,how i use the ajax with data param? 
ahmed201
(Rifajas)
2
ignore the data key in the ajaxSubmitButton. by doing this the yii will automatically post the value of text box to your action automatically 
linuxdrake
(Linuxdrake)
3
I yet think so ,but it don’t work,the action like as:
public function actionAddcart()
{
$ID = $_POST['ID'];
$user = $_POST['user'];
$num = $_POST['qty_item_1'];
if(Yii::app()->request->isAjaxRequest)
{
$comm = YII::app()->db->createcommand();
...
it looks like the action didn’t get the value of qty_item_1
ahmed201
(Rifajas)
4
dump the posted values like
CVarDumper::dump($_REQUEST);
refer manuals about ajax here