How to make a data feed into to other textboxes?

Hi everyone,

I would like to seek your help on this. I have a dropdownlist that displays ids of student.

<div class="row">

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

<?php echo $form->dropDownList($model,'student_id', CHtml::listData(Student::model()->findAll(), 'student_id', 'student_id'), array('empty' => 'Select Student ID')); ?> 

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


What I want to do is when I select an id, other information of student should feed into the following textboxes:


student gender


<div class="row">

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

<?php echo CHtml::textField("student_name",$model->student_name,array('readonly'=>true)); ?>

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


<div class="row">

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

<?php echo CHtml::textField("student_gender",$model->student_gender,array('readonly'=>true)); ?>

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


<div class="row">

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

<?php echo CHtml::textField("student_year",$model->student_year,array('readonly'=>true)); ?>

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


Can you please help me shed some light on this?



this might not be exactly what you need but it will help you get there

Thanks, alirz23! I’ll look into it.