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 7788509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:01:43+00:00 2026-06-01T21:01:43+00:00

I started using jquery and jquery-ui. I am facing a problem trying to submit

  • 0

I started using jquery and jquery-ui. I am facing a problem trying to submit a form that is inside a tab. Once i hit ‘submit’, the page refresh itself, the tabs are gone, and the url is changed to the tab’s function url. the submit button is working, and i get the desired result. However, it is not on the same page as the tabs.

Does anyone have any idea on how to keep the page from refreshing?

example of my problem:

I have a page called ‘index.php’ with 3 different tabs. one of the tabs is called ‘submit form’ where there I have a form using POST method, it is taking its source from ‘form.php’. once i hit the ‘submit’ button, the page refreshes, the url changes from ‘www.example.com’ to ‘www.example.com/form.php’, i get the result there, but the page is “plain”, means that its not under a tab, just a normal page.

I hope I explained myself correctly.

Thanks!

EDIT:
here is my submission code:

$submit = $_POST['submit'];
$name= $_POST['name'];

if($submit){
echo 'submitted <br><br>';
echo "hello $name";
}
  • 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-01T21:01:49+00:00Added an answer on June 1, 2026 at 9:01 pm

    Capture the form submission in jQuery and then stop it with preventDefault();

    $(function(){
      $('#formID').on('submit', function(e){
        e.preventDefault();
        var formSrc = $(this).attr('action');
        var formMethod = $(this).attr('method');
        var formData = $(this).serialize();
        $.ajax({
          url: formSrc,
          type: formMethod,
          data: formData,
          success: function(data){
            //work with returned data from requested file
            alert(data);
          }
        });
      });
    }); 
    

    EDIT:

    i should add that I chose to use on(); as opposed to the default submit(). This is because the form may or may not be available at DOM.ready.

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

Sidebar

Related Questions

I have started using jQuery and rails. I have made a simple form that
I have my application using jQuery heavily. The problem is that we started with
I started using jQuery Mobile some time ago, and as those that know jQuery
Hey! I've finally started feeling comfortable using jQuery, so now I'm trying to improve
Recently I started using https://github.com/crowdint/rails3-jquery-autocomplete It works great, but I was trying to set
I using jquery form plugin from malsup http://jquery.malsup.com/form/ In the http://jquery.malsup.com/form/#getting-started example, how do
I have just started using jQuery and although following code gets the job done,
I recently started using JQuery and created a little slider to display logos of
I am currently working on a web app using Wicket and started using jQuery
Let me preface this question. I have just started using jquery, so please be

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.