Passing of variable data to models

Hi,

I want to pass a default value: status = "active"

This is my form for now:




      <div class="row">

		<?php echo $form->labelEx($model,'crop_Name'); ?>

		<?php echo $form->textField($model,'crop_Name',array('size'=>60,'maxlength'=>255)); ?>

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

	</div>



It askes only a [color="#FF0000"]crop name[/color]. [color="#FF0000"]crop_id[/color] is INCREMENTAL. [color="#FF0000"]status[/color] is either active or inactive…

Then in the manage section, I would like it to be a button, check or wrong to change it to inactive and active setting…

So, I need to know how to pass default values into models

and showing a button in the manage crops sections for active and inactive

Passing a default value is RESOLVED.

Can someone help me with this , showing a button in the manage crops sections for active and inactive

I used this approach at one of the projects:




                  $this->widget('zii.widgets.jui.CJuiButton',

                                array(

                                    'buttonType'=>'checkbox',

                                        'name'=>'Selected['.$model->AdId.']',

                                        'caption'=>$model->getAssociateCaption($checked),

                                        'value'=>$checked,

                                        'htmlOptions'=>array(

                                            'value'=>$checked,

                                        ),

                                        'onclick'=>'js:function(){updateAssociation('.$model->AdId.', $(this).val())}'

                                    )

                                );