ajax loads content how to submit form
Hi
I have made so that my content is loaded with ajax like this and placed in a div
- <ul id="navlist">
- <li><a href="home.php" class="home">Home</a></li>
- <li><a href="gallery.php" class="gallery">Gallery</a></li>
- <li><a href="upload.php" class="upload">Upload</a></li>
- </ul>
- <script>
- $(function () {
- // attaching click handler to links
- $("a.upload").click(function (e) {
- // cancel the default behaviour
- e.preventDefault();
- // get the address of the link
- var href = $(this).attr('href');
- // getting the desired element for working with it later
- var $wrap = $('#container');
- $wrap
- // removing old data
- .html('')
- // slide it up
- .slideUp()
- // load the remote page
- .load(href + ' #laddaupp', function () {
- // now slide it down
- $wrap.slideDown();
- });
- });
- });
- </script>
But on one page I have a submit form that uploads to a database and saves in the folder on the server but when I click on submit it goes to the original upload.php how can i make it stay on the same page/div?