I have this code:
echo $form->dropDownList($model,
'defaultPrinterId',
CHtml::listData(Printer::model()->findAll(), 'id', 'name'),
array('prompt' => '-- None--'));
Which gives me a dropdown like this:
<select id="LabelType_defaultPrinterId" name="LabelType[defaultPrinterId]">
<option value="">-- None --</option>
</select>
However, when a value is added to my table in form messages, where defaultPrinterId is 0. Instead, how would I make it null, since this is a field with a null value?
source
share