I'm using wbraganca dynamic form in Yii2-advanced-app. Where I want to take a custom field. But I don't understand how to handle it with onchange. Because the id's of all fields are changing dynamically as we click on 'add' button.

I want to change only the respected 'available qty' on changing the corresponding 'SKU'. That is if sku with id sku0 is selected, then it's available qty i.e. avlqty0 should be changed(...Sku1--->avlqty1 & so on...). But I can't get the id because it changes dynamically.
Here is my code -
<div class="col-lg-2">
<?= $form->field($model, "[{$i}]SKU")->dropDownList(ArrayHelper::map(CompItems::find()->where(['id' => 0])->all(),'id','SKU'),['prompt' => 'Select SKU',
'onchange' => '
$("#avlqty").val(100);']) ?>
</div>
<div class="col-lg-3">
<div class="form-group" style="margin-bottom: 10px;">
<label for="avlqty">Available Qty:</label>
<input type="text" class="form-control" id="avlqty" value="" readonly="true">
</div>
</div>