how to populate data by default in create.php

Hi,Is it possible to populate the data in my textfield by default in _form.php ?

example if I have this form

trn# 00005 //Here I want to put default value which is pulled out from my table trns_tble .ex. 00005







<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(


	// Please note: When you enable ajax validation, make sure the corresponding

	// controller action is handling ajax validation correctly.

	// There is a call to performAjaxValidation() commented in generated controller code.

	// See class documentation of CActiveForm for details on this.


)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>


    <div class="row">

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

        <?php echo $form->textField($model,'trans_no'); ?>

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


	Other textfields......


<?php $this->endWidget(); ?>

</div><!-- form -->

I suppose that U already have that default value that U want to set as textfield value.

Let’s say it’s $default.

all U should do is to form that code line like:

<?php echo $form->textField($model,‘trans_no’, [‘value’ => $default]); ?>

but please check this for closer explanation:

Thank you :)