Where to define parameter for searchModel

hi guys, i will get following error using JQuery-Searchfunction in yii2

Bad request(#400)

Missing parameters

I know,that SearchModel requires in this case id as parameter, but unless Searchfunction won’t be rendered in controller,I have no idea,where to implement parameter passing.

I try like this, but didn’t succeed with it:

First in GridView(index.php)

$search = "$('.search-button').click(function(){


return false;



<div class="search-form_adressen" style="display:none">

    <?= $this->render('_search', ['model' => $searchModel,'id'=>6]); ?>


Second in _seach.php(formular)

    <div class="form-group">

        <?= Html::submitButton(Yii::t('app', 'Searching'), ['class' => 'btn btn-primary','id'=>6]) ?>

        <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?>


Here is Searchmodel

Any ideas, where to implement parameter passing correctly?

Got it by my own. Finally

There are two positions defining id. First is in View like this


    $this->render('_search', [

        'model' => $searchModel,

        'id' => $id,



Second is ActiveForm in _search.php like this:


]    $form = ActiveForm::begin([

                'action' => ['index','id'=>$id],

                'method' => 'get',




So, this thread can be closes as succesfully solved