I have this Js/Ajax code:
<script type="text/javascript">
$(document).ready(function(){
$("#message").hide();
$("#addsliderimage").submit(function(e){
e.preventDefault();
dataString=$("#addsliderimage").serialize();
$.ajax({
type: "POST",
url: "addsliderimage_go.php",
cache: false,
data: dataString,
success: function(res){
//$("#message").show();
$("#message").html(res);
$('#message').fadeIn('slow');
if(res.indexOf("success")!=-1)
{
window.location.href = res.substr(8);
}
}
});
});
});
</script>
when the form is submitted, the page with the form on doesn't change the page is just submits the data to the URL in the ajax code.
i know this works as im using it on other forms however on this particular form im uploading images/files so i need a way to set the enctype to multipart/form-data