The dependent drop-down list does not have to change automatically

I am creating a dependent drop-down menu and it works correctly, but I want the second select not to be automatically changed to the first value. I want it to be at ‘prompt’ => ‘Select …’,

Select 1

<?php $clientes=Clientes::find()->where(['idruta' => Yii::$app->user->identity->idruta])->all();
       $listData=ArrayHelper::map($clientes,'id','fullName');
       echo $form->field($model, 'idcliente')->widget(Select2::className(),   
    )->label('Cliente')->dropDownList(
            $listData,
            ['prompt'=>'Selecionar...',
             'onchange' => '
            $.post(
                "' . Url::toRoute('getoperations') . '", 
                {id: $(this).val()}, 
                function(res){
                    $("#requester").html(res);
                }
            );
        ',]);?>

Select 2

<?= $form->field($model,'idventa')->widget(Select2::className(),   
        )->label('Venta')->dropDownList( [ ],
        [
        'prompt' => 'Selecionar...',
        'placeholder' => 'Selecionar..e.',
        'id' => 'requester',
        ]); ?>

Controller

public function actionGetoperations()
{
if ($id = Yii::$app->request->post('id')) {
    $operationPosts = \app\models\Clientes::find()
        ->where(['id' => $id])
        ->count();

    if ($operationPosts > 0) {
        $mjs1 = "Credito de ";
        $mjs2 = " Cuota de ";
        $operations = \app\models\Ventas::find()
            ->where(['idcliente' => $id])
            ->andwhere(['>=', 'saldo', 1])
            ->all();
        foreach ($operations as $operation)

            echo "<option value='" . $operation->id. "'>" .$mjs1. $operation->valor .$mjs2. $operation->cuotas . "</option>";
    } else
        echo "<option>-</option>";

}
}

Hi Japiedrahita,

Please use the following code for your action …

public function actionGetoperations() {
if ($id = Yii::$app->request->post('id')) {
    $operationPosts = \app\models\Clientes::find()
            ->where(['id' => $id])
            ->count();

    if ($operationPosts > 0) {
        $mjs1 = "Credito de ";
        $mjs2 = " Cuota de ";
        $operations = \app\models\Ventas::find()
                ->where(['idcliente' => $id])
                ->andwhere(['>=', 'saldo', 1])
                ->all();
        echo "<option value='' selected>- Selecionar... -</option>"; //Add your option at first... it will show at first instead first value of the option 
        foreach ($operations as $operation) {
            echo "<option value='" . $operation->id . "'>" . $mjs1 . $operation->valor . $mjs2 . $operation->cuotas . "</option>";
        }
    } else
        echo "<option>-</option>";
}

}

HI arojohnson
I changed the code and it works correctly
Thank you so much