Assume I have a form with 2 select box (dropdown list) named country and province. When I choose any item in country box, the correspond provinces with the selected country will be loaded automatically without reloading page. Can anyone give me any advices for this issue in yii.
then after create the Getprovince function on your controller
public function actionGetprovince($id){
$county_id=$_POST['county_id'];
$data=Provinces::model()->findAll("county_id='".$county_id."' AND status='1'");
$data=CHtml::listData($data,'id','provinces_name');
echo "<option value=''>Select Event</option>";
foreach($data as $value=>$event_name){
echo CHtml::tag('option', array('value'=>$value),CHtml::encode($event_name),true);
}
}
I want data input in first model AddSchool but when i input data in AddStudent using create view it should be auto update text field i.e.,school_logo,school_address,school_phone,school_email,school_website on select dropdown list of school_name.