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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:33:03+00:00 2026-05-14T00:33:03+00:00

I’m using a JQuery Tabbed Menu which holds different types of forms and when

  • 0

I’m using a JQuery Tabbed Menu which holds different types of forms and when I select a different form located under a different tab and submit the form the tab will jump to the default tab instead of the current tab the form is located in.

I was wondering how would I go about fixing this so that when the form is submitted the current tab is still selected, is it the JQuery or PHP problem?

Here is the JQuery.

$(document).ready(function() {

    //When page loads...
    $(".form-content").hide(); //Hide all content
    var firstMenu = $("#home-menu ul li:first");
    firstMenu.show();
    firstMenu.find("a").addClass("selected-link"); //Activate first tab
    $(".form-content:first").show(); //Show first tab content

    //On Click Event
    $("#home-menu ul li").click(function() {

        $("#home-menu ul li a").removeClass("selected-link"); //Remove any "selected-link" class
        $(this).find("a").addClass("selected-link"); //Add "selected-link" class to selected tab
        $(".form-content").hide(); //Hide all tab content

        var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the selected-link tab + content
        $(activeTab).fadeIn(); //Fade in the selected-link ID content
        return false;
    });

});
  • 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-05-14T00:33:04+00:00Added an answer on May 14, 2026 at 12:33 am

    It is, that when you Submit a form the page Refresh cause it send data to the server, and javascript keep simply the start position on page Load!

    you must do an AJAX call if you want achieve what you want!

    you can use also some plugin like this

    http://www.mikage.to/jquery/jquery_history.html

    IMHO you need to start from scratch with AJAX!

    so read this tutorial!

    http://php4every1.com/tutorials/jquery-ajax-tutorial/

    basically your form look like this:

    <form methot="POST" action="yourphppage.php" name="myform" id="myform">
          <input type="text" value="" id="username" />
    

    you need to pass your data to the AJAX by doing something like this!

    $('#myform').submit(function() {
    
    var username = $('username').val();
    
    $.ajax({
    type: "POST",    
    url: "yourphppage.php",    
    data: "action=postdata&username=" + username,    
    success: function(data){
       // at this point if all is ok you 
    //receive data back and you can do other stuff!   
     // data is what you keep back from server (php)    
       $('#your_div_that_hold_ajax_responce').html(data);
    
    }, error: function(data){
     alert('something goes wrong!');    
    }   
    }); 
    });
    

    you php code look like this:

    if ( isset( $_POST['action'] ) ) {
    
    switch($_POST['action']) {
    
    case 'postdata':
    echo $_POST['username'];
    break;
    
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 378k
  • Answers 378k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use my Export2SqlCE command line utility, which scripts both data… May 14, 2026 at 9:23 pm
  • Editorial Team
    Editorial Team added an answer Unless you're overflowing or underflowing, it definitely sounds like something… May 14, 2026 at 9:23 pm
  • Editorial Team
    Editorial Team added an answer You could use ASIHTTPRequest to make asynchronous web requests, i.e.… May 14, 2026 at 9:23 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.