I am uploading a form with file and other inputs and all that is working fine. But the problem is that it is loading a new page i.e
www.mywebsite.com/controller/function.
My code :-
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
<script src="http://malsup.github.com/jquery.form.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var options = {
clearForm: true,
resetForm: true
};
// bind 'myForm' and provide a simple callback function
$('#myForm').ajaxForm(function() {
//alert("Thank you for your comment!");
});
$('#myForm').ajaxForm(options);
});
</script>
</head>
<body>
<form id="myForm" name="myForm" action="/main/comment" method="post" enctype="multipart/form-data">
<input type="text" name="name" />
<br />
<textarea name="comment">