There is a form with a checkbox. Here the data from the database - areas.

enter image description here

And there is also a form with a checkbox with zones of these areas.

enter image description here

Between the tables are connected by key. And such a query finds zones that correspond to the desired area.

<?= $form->field($objects, 'options_zones_cities')->checkboxList(ArrayHelper::map(\common\models\zones\CityRegionsZone::find() ->where(['city_region_id' => '86']) ->all(), 'id','name'))->label('Зоны районов Одессы') ?> 

Here you need to substitute the necessary id - each zone has a district id

The ids themselves are in option

enter image description here

How do I get the id of the selected area, then show the zones that correspond to them (upon request). The ajax form itself, i.e. id, you can choose dynamically

enter image description here

Here 86.87 is the id of the selected items.

The question is how to use js - 1) to get id 2) to transfer id to request 3) to show zones, according to districts (upon request)

    0