I’m new to yii framework. I have created a simple dropdownlist.
echo $form->dropDownList($model, 'max_cost', array('2'=>'Yes', '0'=>'No'),
array(
'empty'=>'Choose one',
'onchange'=>'alert(item.value);',
)
);
Now when I select Yes, the alert box will display Yes and when i select no the alert box will display no.
Suppose I want to display 2 when I select yes and 0 when I select no . What should I do for this? item.value displays the RHS I want to display LHS