$('#submit').on('click', function() {
$.ajax({
url: "controller/php/add_project.php",
type: "POST",
data: new FormData(document.getElementById("add_project_form")),
contentType: false,
processData:false,
cache: false,
success: function(dataResult){
console.log(dataResult);
var dataResult = JSON.parse(dataResult);
},
error:function(dataResult){
console.log(dataResult);
alert('error / Add Project Again');
}
});
});
$.ajax({
url: "jobs/php/job_single.php?type=500",
type: "POST",
data: new FormData(document.getElementById("form")),
contentType: false,
processData:false,
cache: false,
success: function(dataResult){
console.log(dataResult);
if(dataResult == 999){
alert("Incomplete Information Provided");
}
else{
if(dataResult == 1){
alert("Job Application successful");
location.reload();
}
else if(dataResult == 0){
alert("Error applying for job, Please try again");
}
}
}
});
var form = // Select your form here;
var fmData = new FormData();
form.append('name',fmData);
$.ajax({
url:'URL',
type:'POST',
data:fmData,
success:function(){},
error:(er){}
})
$.ajax({
...
data: $("#registerSubmit").serialize(),
...
})