The problem is, there is ajax upload file upload, everything works, but I want to transfer along with the file the value of the select in postData: I tried this way and that, it doesnβt work out how to do it properly, advise, here is the select and the upload script transfers only that select that was selected when the page loads
$('document').ready(function ($, data) { $('.upload').upload({ action: '/admin/upload', label: 'ΠΠ΅ΡΠ΅ΡΠ°ΡΠΈΡΠ΅ ΡΠ°ΠΉΠ» ΠΈΠ»ΠΈ ΠΊΠ»ΠΈΠΊΠ½ΠΈΡΠ΅ Π΄Π»Ρ Π²ΡΠ±ΠΎΡΠ°', postKey: 'newfile', maxQueue: 1, postData: ({data: data = $('#my_select').val()}), maxSize: 300485760 }).on("start.upload", Start) .on("filestart.upload", fileStart) .on("fileprogress.upload", fileProgress) .on("filecomplete.upload", filePComplelele) .on("fileerror.upload", fileError) .on("complete.upload", Complete); });
<select id="my_select"> <option value="1">Π‘ΠΏΠΈΡΠΎΠΊ 1<option> <option value="2">Π‘ΠΏΠΈΡΠΎΠΊ 2<option> <option value="3">Π‘ΠΏΠΈΡΠΎΠΊ 3<option> <option value="4">Π‘ΠΏΠΈΡΠΎΠΊ 4<option> </select>
$('#my_select option:selected').val()
? - Alexey Shimansky