Update Record , But Only Field Not Set

Hello I have a question for you, I have a db which we assume each record has 50 fields between which there is a field "name the first time will only set the first 5 fields (also named). Here comes the problem, by using a query before inserting or do an update would check if the name is already present here are 2 alternatives:

not-present: everything appears in the form with 50 fields

-present: everything appears but the form with the fields in the db already written in the form, and then do the update, and so far it would be easy. What I want is that the fields are already present in the db are shown but there is no way of being able to re-edit that perform the update of the new fields entered by the user and not be able to edit those in the db.

How do you think could be done?


I’m not sure what you are trying to do, but in the form you could check is $model->fieldX has a value and ‘readonly’=>‘readonly’ the the htmlOptions array() OR you could display the value only

<div class="row">

   <?php echo $form->lableEx($model, 'fieldX'); ?>

   <?php if (isset($model->fieldX) {

      echo CHtml::encode($model->fieldX);

   } else {

      echo $form->textBox(($model, 'fieldX');

   } ?>

   <?php echo $form->error($model, 'fieldX'); ?>


Understand this is top of head, to give an idea.