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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:18:37+00:00 2026-05-22T15:18:37+00:00

I have created a Check Out wizard utilizing the jQuery UI Tabs in an

  • 0

I have created a Check Out wizard utilizing the jQuery UI Tabs in an Asp.Net MVC 3 website. Each tab in the wizard loads a partial view containing a form. If the form is valid, I post the form data and save it to the database.

Currently I am able to check the client-side validation and if the current tab is not valid, prevent the next/previous tab from being selected when the next or previous button is clicked using the method described here http://jqueryui.com/demos/tabs/#…prevent_switching_to_the_tab_on_click_depending_on_form_validation.

However, not all of the validation can be done client-side as we need to perform some server side checks. So if a tab passes the client-side validation, then I submit the form and check the response returned from the server. If server-side validation passes an empty string is returned, but if it fails I return the same partial view for that tab.

Here is the select function in my jQuery UI Tabs selector:

select: function (event, ui) {

            var checkOutTabs = $(".checkout-tabs").tabs();
            var currentTabIndex = checkOut.getSelectedTabIndex();
            var currentTab = $(".checkout-step").get(currentTabIndex);

            var isValid = checkOut.validateTab(currentTab, ui.index);

            //prevent tab change
            if (!isValid) {
                return false;
            }

            var form = $(currentTab).find("form");

            //Submit this tab
            $.post(form.attr("action"), form.serialize(), function (data) {

                if (!data) {
                    checkOutTabs.tabs("enable", ui.index + 1);
                    return true;
                } else {
                    $(currentTab).find(".checkout-step").parent().html(data);
                    return false;
                }

            });
        }

The problem I am having is that as soon as I call the jQuery $.post() method, the tabs switch to the next tab, regardless of wether I return true or false. I found a post ( Better Way to Build jQuery Tabs ) that is doing a smiliar implementation, but they didn’t report having this issue. Am I doing something wrong, or is this the expected behavior?

  • 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-22T15:18:38+00:00Added an answer on May 22, 2026 at 3:18 pm

    $.post returns immediately as it’s asynchronous

    maybe you have to block (using async = false in $.ajaxOptions or something) until response is get, then return what you want by changing a broader-scoped variable

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

Sidebar

Related Questions

I have created a new ASP.NET MVC project using the MVC Project Template. According
I have a loop created with each, check this example: $('.foo').each(function(i){ //do stuff });
I have created the widget in Jquery mobile for Tabs. I want that when
I have created a Check box JQuery Plugin, but when i want to get
I have created a DeclarativeServiceLibrary using VS2010 beta 2, Please check this image of
Hey, so I have created a function to check the DB for unique entries,
I have created a Authentication Interceptor in struts2. I have to check that when
I have created a <form> that points to http://localhost:17099/Form/Subscribe and hosted in my website...
I have created a program to check for input range for integer variable paycategory
I have created a User Control with 4 check boxes(server control). I want to

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.