Dependent Dropdowns Not Resetting Correctly In Yii

I have two dependent drop downs Category & Role in my form.Dependent on category dropdown’s selected value role will change.I am doing this with ajax request, like

<?php echo $form->dropDownList($model,'job_category',


                    $categorylist,


                    array('empty'=>'Select',


                    'ajax'=>array('type'=>'POST',


                    'url'=>CController::createUrl('dynamicstates'), 


                        'update'=>'#role_id','data'=>array('id'=>'js:this.value')))); ?>

It is working fine.But I have a CHtml::resetButton in my form.On resetting two drop downs are expected to reset the values.In my case category dropdown is resetting correctly.But role drop down is not getting the previous value.Ajax request is not triggering while resetting the form.

Hi,

you have to reset role by code, because the ajax part isn’t used unless you change manually the value of the category.

Thank you ragua,Let me try to do in code.

Sorry,Instead of that i have tried location.reload() on clicking reset button.Because in my form i have some option to dynamically create rows.While clicking reset button those rows also have to reset.So to reset dynamically created rows and dependent drop downs , i have used location.reload().It is working fine in Mozilla.but in chrome it is wrongly redirecting from update to admin page while reloading the page from reset button click.But if i am clicking F5 in my chrome it is reloading correctly.