Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Unable To Get Combo Box Value To Save?

$
0
0
I am new to YII. I have form which is used "Role" combo box (from model there is method). When I store in db , the value is always 0. The html is below
<div class="row">
	<?php echo $form->labelEx($model,'userType'); ?>
        <?php echo $form->dropDownList($model,'userType', $model->getUserTypeOptions()); ?>        
	</div>
and then my model is
public function getUserTypeOptions()
        {
           return array(
               '1' => 'Administrator',
               '2' => 'Team Member'
           ); 
        }
             
How to resolve this problem?

Viewing all articles
Browse latest Browse all 18717

Trending Articles