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 created an UITabView application. Each view selected from the bar is a
I am working on splitting out an existing, working application that I currently have
We have created a common threading framework to manage how we want to use
I have been through every option to try to find a way to get
I have set up a server to handle my source control with Visual Svn
We have two websites for the same client (main www site and another for
I'm a ClearCase newbie and up until now have been used to SVN. Therefore,
OK, I'm trying to make an empty version of a database on another instance
Problem overview: When using Eclipse Ganymede with the Web Tools Platform the project gets

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.