echo $form->hiddenField($model, 'addressbookid');
?>
	<p class="note">Fields with <span class="required">*</span> are required.</p>

    <div class="row">
		<?php 
echo $form->labelEx($model, 'contacttypeid');
echo $form->hiddenField($model, 'contacttypeid');
?>
          <input type="text" name="contacttype_name" id="contacttype_name" readonly value="<?php 
echo Contacttype::model()->findByPk($model->contacttypeid) !== null ? Contacttype::model()->findByPk($model->contacttypeid)->contacttypename : '';
?>
">
          <?php 
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'contacttype_dialog', 'options' => array('title' => Yii::t('app', 'Contact Type'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true)));
$contacttype = new Contacttype('searchwstatus');
$contacttype->unsetAttributes();
// clear any default values
if (isset($_GET['Contacttype'])) {
    $contacttype->attributes = $_GET['Contacttype'];
}
$this->widget('zii.widgets.grid.CGridView', array('id' => 'contacttype-grid', 'dataProvider' => $contacttype->Searchwstatus(), 'filter' => $contacttype, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("+",
                array("name" => "send_contacttype",
                "id" => "send_contacttype",
                "onClick" => "$(\\"#contacttype_dialog\\").dialog(\\"close\\"); $(\\"#contacttype_name\\").val(\\"$data->contacttypename\\"); $(\\"#Bankcontact_contacttypeid\\").val(\\"$data->contacttypeid\\");"))'), 'contacttypeid', 'contacttypename', array('class' => 'CCheckBoxColumn', 'name' => 'recordstatus', 'selectableRows' => '0', 'header' => 'Record Status', 'checked' => '$data->recordstatus'))));
$this->endWidget('zii.widgets.jui.CJuiDialog');
echo CHtml::Button('...', array('onclick' => '$("#contacttype_dialog").dialog("open"); return false;'));
?>
		<?php 
echo $form->error($model, 'contacttypeid');
?>
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Contacttype::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }