Dependent Dropdown And Update A Div

This is the documentation : Yii 1.1: Creating a dependent dropdown

http://www.yiiframework.com/wiki/24/

all this is working fine, but how i can add a small functionality to update a div, with the selected value. ?


<?php echo CHtml::dropDownList('country_id','', array(1=>'USA',2=>'France',3=>'Japan'),

array(

'ajax' => array(

'type'=>'POST', //request type

'url'=>CController::createUrl('currentController/dynamiccities'), 

'update'=>'#city_id', //selector to update


))); 

echo CHtml::dropDownList('city_id','', array());

?>

<div is="show-selected"><div>

Thank you

Add in ajax array instead of ‘update’ key (not tested)




    'success' => 'function(data){

        jQuery('#city_id').html(data);

        jQuery('#show-selected').html(jQuery('#country_id').val());

    }',



Good one, thank you Bizley!