I wanna set value one of the field by jquery. Get Value from on field and set it to another field. Got something like this:
$(document).on("click", "a.order_products-collection-rescue-add", function({
$(".chosen-select").chosen();
var $product_search = $('order_product');
$product_search.change(
function() {
var single_price = $(this).find('option.single_option:selected').attr('single_price');
$(CURENT INDEX OF COLLECTION ROW).('input.single-price-field').val(single_price);
console.log(this);
}
);
});
Everything works fine, but! How i can get Curent Index of Collection Row ?
If I click resecue-add button thats embbed my a new form im getting attr single_price from selected option and in new form is second field with class single-price-field, how to get exaclly this form filed ? i don
t know how to get index of this form.