The bottom line is that there is ajax, which passes the form to the handler, but I do not understand how to return the result to the right div ? Here is a piece of ajax
function sendAjaxForm(result_form, ajax_form, url) { jQuery.ajax({ url: "/auto_sm.php", //url страницы (action_ajax_form.php) type: "POST", //метод отправки dataType: "html", //формат данных data: jQuery("#"+ajax_form).serialize(), // Сеарилизуем объект success: function(response) { //Данные отправлены успешно output = jQuery.parseJSON(response); document.getElementById(result_form).innerHTML = output; }, error: function(response) { // Данные не отправлены document.getElementById(result_form).innerHTML = "Ошибка. Данные не отправлены."; } }); } I need a file auto_sm.php, after submitting the form, get the variable $output in the desired div , help, please.
console.log(response);- ?? - Igorsuccess, something happens in the case of200responses. what is the problem??? - n.osennij