0
Next, I have an ajax code that takes values from a form and sends it to a page. But I need to send together a return that I have already obtained in an ajax passage.
$('#form1').on('submit', function (e) {
var dados = new FormData(this);
$.ajax({
contentType: "charset=UTF-8",
url: 'buscar.php',
type: "POST",
dataType:"html",
data: dados,
processData: false,
cache: false,
contentType: false,
success: function (data) {
$('.primeira').hide();
$('.segunda').show();
$('#resultado').html(data);
}
});
return false;
});
This above code I get an array list and display in the result #. How I send this result to another page along with a form reply?
$('#form2').on('submit', function (e) {
var dados = new FormData(this);
var id = $('#resultado').val();
$.ajax({
contentType: "charset=UTF-8",
url: 'lista.php',
type: "POST",
dataType:"html",
data: {dados, id},
processData: false,
cache: false,
contentType: false,
success: function (data) {
$('.segunda').hide();
$('#resultado').html(data);
$('.terceira').show();
}
});
return false;
});
Here above is the part where I send a second form... However how to send what is in the div #result together?