Показать сообщение отдельно
  #1 (permalink)  
Старый 20.06.2017, 09:47
Профессор
Отправить личное сообщение для Sav2907 Посмотреть профиль Найти все сообщения от Sav2907
 
Регистрация: 15.09.2015
Сообщений: 180

Помогите отравить форму (+файлы)
<form method="POST" id="formx" enctype="multipart/form-data">
<input type="text" id="inp_1" name="inp_1"><br>
<input type="text" id="inp_2" name="inp_2"><br>
<input type = 'file' name = 'upfiles[]' /><br>
<input type = 'file' name = 'upfiles[]' /><br>
<input type = 'file' name = 'upfiles[]' /><br>
</form>
<button id="send_formx">Отправить</button >
<script>
$('.submit').on('click', function(){
	var data = $("#formx").serialize();
	$.ajax({
	type: "POST",
	url: "add_protokol.php",		
	data: data,
	dataType: "json",
	success: function(response){				
		if (response.status == 'nOK'){
			alert(Отправлено);
			}
		if (response.status == 'OK'){				
			alert(Не отправлено);									
			}
	}
	});
});
</script>
Ответить с цитированием