Example #1
0
    <p class="help-block">Fields with <span class="required">*</span> are required.</p>

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

            <?php 
echo $form->textFieldControlGroup($model, 'name', array('span' => 5, 'maxlength' => 145));
?>

            <?php 
echo $form->textFieldControlGroup($model, 'judge_code', array('span' => 5, 'maxlength' => 45));
?>

            <?php 
echo $form->dropDownListControlGroup($model, 'designation_id', CHtml::listData(JudgeDesignation::model()->findAll(array('order' => 'id ASC')), 'id', 'designation'), array('span' => 5));
?>
      

            <?php 
echo $form->dropDownListControlGroup($model, 'state_id', CHtml::listData(States::model()->findAllByPk(array(19, 7, 32), array('order' => 'name ASC')), 'id', 'name'), array('ajax' => array('type' => 'POST', 'url' => CController::createUrl('states/dynamicdistrict3'), 'update' => '#Judge_district_id'), 'empty' => 'Select State'), array('span' => 8));
?>
            

            <?php 
echo $form->dropDownListControlGroup($model, 'district_id', CHtml::listData(States::model()->findAll(array('order' => 'name ASC')), 'id', 'name'), array('empty' => '--Select state first--', 'span' => 5));
?>
            
            <?php 
echo $form->dropDownListControlGroup($model, 'gender', array('Male' => 'Male', 'Female' => 'Female'), array('empty' => '--Select--', 'span' => 5));
?>
 /**
  * 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 $id the ID of the model to be loaded
  * @return JudgeDesignation the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = JudgeDesignation::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }