I have many inputs where to dynamically change the value of the name attribute, for example:
Select
<select class="form__input form__select select optional" id="js-customer-field" name="customer[customer_food_attributes][16321232322354][customer_id]"><option value="">Select</option>
...
<select class="form__input form__select select optional" id="js-customer-field" name="customer[customer_food_attributes][023912321331123][customer_id]"><option value="">Select</option>
I would like to take the value to apply to an event, but since the id's are random I don't know how to capture them
on this name attribute or any with random id:
"customer[customer_food_attributes][023912321331123][customer_id]"
$("customer[customer_food_attributes][023912321331123][customer_id]").on('change'), function(e, item) {...})
I would be very grateful if someone could help me build the attribute dynamically Thank you for your time in reading me.