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

  • Home
  • SEARCH
  • 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 3484662
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:48:50+00:00 2026-05-18T10:48:50+00:00

Scratching my head on this one. With jQuery tabs I am attempting to use

  • 0

Scratching my head on this one. With jQuery tabs I am attempting to use ajaxOptions to post data to the page before I load it.

So I have a form on the page before my tabs with some input fields. ie,

<form id="myform" method="post">
<!-- inputs etc -->
</form>

Then my tabs

<div id="tabs">
  <ul>
    <li><a href="#tabs-1">Preloaded</a></li>
    <li><a href="ajax/content1.html">Tab 1</a></li>
  </ul>

  <div id="tabs-1">
    <p>Initital content</p>
  </div>
</div>

ok so now I should be able to serialize my form so when click a tab it should be a post request ie,

$( "#tabs" ).tabs({
    ajaxOptions: {
        type: 'post',
        data: $("#myform").serialize(),
        error: function( xhr, status, index, anchor ) {
            $( anchor.hash ).html(
            "Couldn't load this tab. We'll try to fix this as soon as possible. " +
            "If this wouldn't be a demo." );
        }
    }
});

It does perform the post request but the form data is always empty.

Any ideas why?

Thanks

Lee

  • 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-18T10:48:51+00:00Added an answer on May 18, 2026 at 10:48 am

    Since this runs when you first create the tabs:

    data: $("#myform").serialize(),
    

    The data is whatever it was then, it’s never updated. The easiest solution here is just to update that data when it’s needed, by using the tab’s select event, like this:

    $( "#tabs" ).tabs({
      select: function() {
        $(this).tabs("option", { ajaxOptions: { data: $("#myform").serialize() } });
      },
      ajaxOptions: {
        type: 'post',
        error: function( xhr, status, index, anchor ) {
          $( anchor.hash ).html(
            "Couldn't load this tab. We'll try to fix this as soon as possible. " +
            "If this wouldn't be a demo." );
        }
      }
    });
    

    You can test it out here, just look in Firebug, etc to see the form data is being updated and sent with each tab AJAX request.

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

Sidebar

Related Questions

I have been scratching my head for a while on this one. I dont
I'm scratching my head over this one. Below is a running sample. I have
I'm really scratching my head on this one: I have an object (MyObject) which
I'm scratching my head on this one. I'm trying to use boost::variant to store
I have been scratching my head on this one for a while, so I
I've been scratching my head on this one for a while now and am
This one has me scratching my head. I'm running Subversion 1.3.1 (r19032) on Ubuntu.
I'm really scratching my head on this one. I've been using SimpleDateFormat s with
I've been scratching my head over this one for a couple hours now, I've
Ok, been scratching my head on this one for a bit now... seems related

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.