I am sending form data via an ajax request using jQuery's $.ajax..
It sends some input fields, etc. I also have a file upload button that I need to have function with the jQuery.
How can I do this simultaneously while sending the POST data from the form?
I have found questions answered that explain how to do an AJAX file upload but ONLY that. I need to do the AJAX file upload WHILE submitting POST data from a form filled out...
$('#gobutton').click(function(e) {
e.preventDefault();
var payment_type = $('.change').val();
var terms = 0;
if($('#terms').is(':checked'))
terms = 1;
$.ajax({
url: 'code2.php',
type: 'POST',
data: { gobutton: 'Update',
terms: terms,
file: file
},
success: function(result) {
$('#feedback').html(result);
}
});
});