0

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">
2
Contributors
1
Reply
16
Views
4 Years
Discussion Span
Last Post by LastMitch
0

But the problem is that it is loading a new page i.e

Upload where? Where do you want to upload the page? On your <form> action is:

action="/main/comment"

you have to submit to a file that contain the path to your page that you want it to upload to.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.