How To Use Ajax In Cgridview Button?

Hi i am using ajax button in CgridView.I need to add record of a single student at a time. Here is its view

When button is clicked the two fields namely "Obtained Marks" and "remarks" are sent via ajax request to action. The specific record is updated in the database.

Code is like this

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(



    'action' => Yii::app()->createUrl('SubjectResult/addResult'),



)); ?>

<?php $gridColumns=array(



        'header' => 'Student',


        'htmlOptions' => array('style' => 'text-align:center;'),




        'header' => 'Marks Obtained',



        'htmlOptions' => array('style' => 'text-align:center;')



        'header' => 'Remarks',



        'htmlOptions' => array('style' => 'text-align:center;','id'=>'$data->id')








$this->widget('bootstrap.widgets.TbGroupGridView', array(


	'type'=>'striped bordered',

	'dataProvider' => $dataProvider,

	'template' => "{items}",

	//'extraRowColumns'=> array('firstLetter'),

	//'extraRowExpression' =>  '"<b style=\"font-size: 3em; color: #333;\">".substr($data->id, 0, 1)."</b>"',

	//'extraRowHtmlOptions' => array('row'=>'subject_'.$data->id),

	'columns' => $gridColumns,

        // 'rowHtmlOptionsExpression' => array('row'=>'subject_'.$data->id),

	//'mergeColumns' => array('language')

)); ?>

<?php $this->endWidget(); ?>

<script type="text/javascript">

    function select($id)


        var temp=$('#obtained_marks_'.concat($id)).attr('value');





In ajax button i need to send data. Now it is sending data but i am confused about this that whether my way of doing this is correct or not. I also need to validate data but dont want to write too much javascript code on page.i also need to disable the row whose data is sent so no further data could be sent. I need community`s help about that is there any efficient way of doing this task? I am doing this using POST.