HTML:
<select data-placeholder="Choose a Travel Agency..." class="chosen-select fc-inputbox travel-agency-dropdown" id="travel_agency_id">
... foreach
</select>
Javascript:
var data = {
id: row.find('td:first-child').text().trim(),
travel_agency_name: row.find('td:nth-child(2)').text().trim(),
};
var select_travel_agency = $('.travel-agency-dropdown:first').clone().attr('id', 'travel-agency-id-'+data.id).val(data.travel_agency_name).trigger("chosen:updated");
I've already created the travel agency and what i wanted is to update it while setting the SELECT default value of the agency. The reason why i cloned it is for me to get the datas and without calling another GET