The above solution would search the default value in case the user did not input anything…
If you want a default value to be displayed to the user so that he can change it or add some criteria… in your model… before rendering the view add the desired value to the model field… like
$model = new yourmodel();
$model->voucher_no='3833-';
$this->render(...);
This works if the default filter is set directly on table records, but what about if I want to set a default filter on a related record value ?? I tried to do it like :