Next, I have an ajax code that takes values from a form and sends it to a page. However I need to send a return that I have already obtained in a ajax excerpt.
$('#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 code above I get an array list and display in #result. How do I send this result to another page along with the response of a form?
$('#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 is the part where I send a second form ... But how do I send what's in the div #result together?