i have a model with all the fields about user info. and with crud generator i created views and modified the view, form view, as below
Here i have hidden the editing profile part and when user clicks on edit it shows popup and editfields options. Now the problem is when i submit it submits whole form but i need to submit only the edited part and one more problem is that when i edit something and then cancel the form, it still keeps the value edited and saves then when i submit on any other portion of the form. Please suggest how can i achieve the partial submit of the form
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'my-form',
'enableAjaxValidation'=>true,
'htmlOptions'=>array('enctype'=>'multipart/form-data'),
'action' => Yii::app()->createUrl('/userprofile/editprofile&id='.$model->id),
));
?>
<h4>Edit Profile Pic</h4>
<div>
<?php echo CHtml::fileField('profilePic'); ?>
<div id="editpic"></div>
<div class="btns" id="uploadbutton">
<?php echo CHtml::ajaxSubmitButton('Update', $this->createUrl('/rageprofile/editprofile&id='.$model->id), array('update'=>'#targetdiv'));?>
</div>
</div>
<div class="editbutton">✎ Edit</div>
<div class="eitit edly einfo" style="z-index:9001;" >
<span class="close">✖</span>
<h4>Basic Info</h4>
<?php echo $form->labelEx($model,'firstName'); ?>
<?php echo $form->textField($model,'firstName',array('size'=>30,'maxlength'=>30)); ?>
<?php echo $form->error($model,'firstName'); ?>
<?php echo $form->labelEx($model,'middleName'); ?>
<?php echo $form->textField($model,'middleName',array('size'=>30,'maxlength'=>30)); ?>
<?php echo $form->error($model,'middleName'); ?>
<?php echo $form->labelEx($model,'lastName'); ?>
<?php echo $form->textField($model,'lastName',array('size'=>30,'maxlength'=>30)); ?>
<?php echo $form->error($model,'lastName'); ?><br>
<?php echo $form->labelEx($model,'DOB'); ?>
<?php echo $form->textField($model,'d_o_b',array('size'=>30,'maxlength'=>30)); ?>
<?php echo $form->error($model,'d_o_b'); ?><br>
<?php echo $form->textField($model,'m_o_b',array('size'=>30,'maxlength'=>30)); ?>
<?php echo $form->error($model,'m_o_b'); ?><br>
<?php echo $form->textField($model,'y_o_b',array('size'=>30,'maxlength'=>30)); ?>
<?php echo $form->error($model,'y_o_b'); ?><br>
<?php echo $form->labelEx($model,'City'); ?>
<?php echo $form->textField($model,'city',array('size'=>30,'maxlength'=>30)); ?>
<?php echo $form->error($model,'city'); ?><br>
<?php echo $form->labelEx($model,'State'); ?>
<?php echo $form->textField($model,'state',array('size'=>30,'maxlength'=>30)); ?>
<?php echo $form->error($model,'state'); ?><br>
<?php echo $form->labelEx($model,'Country'); ?>
<?php echo $form->textField($model,'country',array('size'=>30,'maxlength'=>30)); ?>
<?php echo $form->error($model,'country'); ?><br>
<?php echo CHtml::ajaxSubmitButton('Update', $this->createUrl('/rageprofile/editprofile&id='.$model->id), array('update'=>'#targetdiv'));?>
</div>
</div>
</div>
<?php $this->endWidget(); ?>