In Dropdown List I Want To Add Click Or Change Event

Hello Friends,

<?php echo $form->dropDownList($model,'state_id',statemetro::items('stm_id'),array(

                        'prompt'=>'Select State',

						'class'=>'form-control','onChange' => 'userpreference(this.value)',


                            'empty'=>'Pilih Jenis',


                            'url' => CController::createUrl('submarket/dynamicmetros'),

                            'data'=> array('id'=>'js:this.value'),


                        ),'style'=>'width:150px !important;')); ?>

I am writing onChange event but it not working.:( :unsure:

Thanks in advance.

To be more easy try to write jquery (or what you use) event separate from framework. Give the select tag an id and do something similar

$('#someId').on('change', function(){

   //do your trick


Or take a look here