Código Javascript:
Ver original
//Create REPORT $('#reporte').submit(function(e){ e.preventDefault(); var formData = new FormData(document.getElementById("reporte")); formData.append("dato", "valor"); $.ajax({ url: "../model/report_model.php?form=create", type: "post", dataType: "json", data: formData, cache: false, contentType: false, processData: false, beforeSend:function(){ } success:function(data){ console.log(data); $('.msg').html(''); if (data.status == 0) { $('.msg').html("<div class='alert alert-danger fade in'><a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a><b><span id='message'></span></b></div>"); for (var i = 0; i < data.msg.length; i++) { $('#message').append("- "+data.msg[i]+"<br>"); } }else if(data.status == 1){ $('.msg').html("<div class='alert alert-warning fade in'><a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a><b><span id='message'></span></b></div>"); $('#message').append(data.msg); }else if(data.status == 2){ $('#reporte')[0].reset(); $('.msg').html("<div class='alert alert-success fade in'><a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a><b><span id='message'></span></b></div>"); $('#message').append(data.msg); $('body,html').animate({scrollTop : 200}, 500); return false; } } }) })//--create REPORT
Se les agradece..