Hi
I have uploaded files before but not using jquery but now am trying to use jquery so that my files uploads without page refreshing.
This is my Jquery code. and below is the html code. Can any one help me with the jquery code so that I can get the data to the php script that processes
he variable. This is not
<script type="text/javascript" >
$(document).ready(function() {
$("#blogform").submit(function() {
var blogtitle = $("#blogtitle").val();
var bloggenre = $("#bloggenre").val();
var blogcontent = $("#blogcontent").val();
var blogphoto = $("#blogphoto").val();
var blogphoto2 = $("#blogphoto2").val();
var blogweblink = $("#blogweblink").val();
var dataString = 'blogtitle='+ blogtitle + 'bloggenre=' + bloggenre + 'blogcontent=' + blogcontent + 'blogphoto=' + blogphoto + 'blogphoto2=' + blogphoto2 + 'blogweblink=' + blogweblink ;
if(blogtitle=='' || bloggenre=='' || blogcontent =='' || blogphoto=='' || blogphoto2=='' || blogweblink =='')
{
$("#allresult").html('no');
}
else
{
$.ajax({
type: "POST",
url: "ajaxblog.php",
data: dataString,
success: function(){
$("#allresult").html('yes');
}
});
}
return false;
});
});
</script>
I get a yes at div allresults indicating validation worked but I can not
get ajaxblog.php recieving the data.
/html form attributes look like this.
<form id="blogform" method="post" enctype="multipart/form-data" action=''>
</form>
North America
Europe, Middle East and Africa
Asia Pacific