Hi,
I am looking for any video tutorial for file upload using on JQuery or Ajax.
I am in process of searching on google.
Advise any good tutorial.
I tried modelbox and fancybox with following but not working
<div id="AddDocs" style="display:none">
<form id="addDoc" name="addDoc" action="#" method="post" enctype="multipart/form-data">
<input type="hidden" name="frmAction" id="frmAction" value="Submit">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td> </td>
</tr>
<tr>
<td width="40%"><span class="style3">*</span>Upload Documents</td>
<td width="60%"><input type="file" name="txtDocument" id="txtDocument" value="">
</td>
</tr>
<tr>
<td><input type="image" id="AddDocument" tabindex="6" src="includes/images/submit.jpg" border="0"/></td>
<td align="left"> </td>
</tr>
</table>
</form>
</div>
<script type="text/javascript">
$(document).ready(function() {
$(".modalbox").fancybox();
$("#addDoc").submit(function() { return false; });
$("#AddDocument").on("click", function(){
var Documentval = $("#txtDocument").val();
if(Documentval == "") {
$("#txtDocument").addClass("error");
}
else if(Documentval != ""){
$("#txtDocument").removeClass("error");
}
if(Documentval != "") {
// if both validate we attempt to send the e-mail
// first we hide the submit btn so the user doesnt click twice
$("#AddDocument").replaceWith("<em>uploading...</em>");
$.ajax({
type: 'POST',
url: 'AddDocs.php',
data: $("#addDoc").serialize(),
success: function(data) {
if(data == "true") {
$("#addDoc").fadeOut("fast", function(){
$(this).before("<p><strong>Success! Your document uploaded.</strong></p>");
setTimeout("$.fancybox.close()", 10000);
window.location.reload(true);
});
} else {
$("#addDoc").fadeOut("fast", function(){
$(this).before("<p><strong>Sorry! Your operation failed.</strong></p>");
setTimeout("$.fancybox.close()", 10000);
window.location.reload(true);
});
}
}
});
}
});
});
</script>
-Thanks