Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8396587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:34:24+00:00 2026-06-09T20:34:24+00:00

I have a form which automatically refreshes the page on submit, I have tried

  • 0

I have a form which automatically refreshes the page on submit, I have tried adding:

onSubmit="return false;" to the form element, but then the form just stops and nothing happens when you click submit.

I wouldnt mind the page refresh so much but the form is at the bottom of the page and the refresh kicks you back to the top. So I tried this approach:

<form name='test' method='POST' action="index.php" onSubmit="window.scrollTo(5000,500);">

This works for a split second but then something else overrides it (not sure what)

I have also tried using php: header.location just to get a “headers have already been sent” error.

The site in question can be seen here, and the form is at the very bottom.

The only two jquery libraries I am using that I could foresee any conflicts with are nicescroll and (more likely) waypoints, but i dug through them both and couldn’t find any conflicting issues.

If anyone knows of a way to keep the functionality of the form but stop the refresh of the page, that would be wonderful
Thanks

EDIT: After reading the answers below, it looks like I will have to use ajax to acomplish this, I have absolutely no experience with ajax, so I will see how that goes.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:34:26+00:00Added an answer on June 9, 2026 at 8:34 pm

    It seems you need to go through of way of AJAX submission in that case. In that case, you can use jQuery $.ajax() method to do that. A sample below:

    HTML

    <form name='test' method='POST' action="index.php">
    

    jQuery

    $('form[name=test]').submit(function(e) {
       e.preventDefault();
       window.scrollTo(5000,500);
    
       // a sample AJAX request
       $.ajax({
         url : this.action,
         type : this.method,
         data : $(this).serialize(),
         success : function(response) {
    
         }
       });
    });
    

    Here, .preventDefault() is for stop page refresh on form submit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an inout form which populates todays date automatically through the 'today' function.
I have a form which has three inputs when the page loads -- 2
I have a web-page with complicated form. Also, there is a button preview, which
I have an html form which includes a textarea box and a submit button
I have a windows form which has to be refreshed automatically without using any
I have a _form partial which rails automatically names the submit buttons for me,
I have a form on my site which a user can use to submit
I have a form which I want to be 'resusable' for a variety of
I have a form which has a RichTextBox docked to the left and DataGridView
I have a form which POST's its data via AJAX: $.ajax({ type: POST, url:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.