Call an action in Active Form's dropDownList's index

I would like to update partially the page in my _create.php


    

<?php $form = ActiveForm::begin(); ?>


<?= $form->field($model, 'device_type')->dropDownList($deviceTypeModel, [

        'onchange' => 'show($id)']

        );?> 


<?php ActiveForm::end(); ?>



which calls the function on my controller


    

function actionShow($id)

    {

            $searchModel = new Object;

            $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $id);

            

            return $this->renderPartial('service', [

                'searchModel' => $searchModel,

                'dataProvider' => $dataProvider,

            ]);

    }






<?= $form->field($model, 'device_type')->dropDownList($deviceTypeModel, [

'onchange'=>'$.get( "'.Yii::$app->urlManager->createUrl('YourControllerName/show?id=').'"+$(this).val(), function( data ) {

   $( "#DivName" ).html( data );

}',

]);?> 



        '

Thanks for the reply! What should I place under DivName by the way?

Displaying Renderpartial page "service" in that div of my _create.php

I tried it but nothing is happening. What should I do?


 <?= $form->field($model, 'device_type')->dropDownList($deviceTypeModel, [

    'onchange'=>' $.get("'.Yii::$app->urlManager->createUrl("asdf").'")',

    ]) 

I tested the onchange property and placed a random url but I don’t know if it does anything since it does not prompt an error even though the url is invalid.