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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:55:20+00:00 2026-06-11T06:55:20+00:00

I want to show an alert message if user click on second tan without

  • 0

I want to show an alert message if user click on second tan without submitting the form on the first tab, the problem I face of infinite alert messages that’s show when user click on tab,
here is the code I write

 $(function() {
    $('#tabs').tabs({
        selected:<?php echo $param ?>,

        select: function(e, ui) {

            var thistab = ui;
            runMethod();

        }

    });

});
function runMethod(){
    if( $.trim($("#generalImportNo").text()) == "")
    {
        alert("You should fill all main information first.")                     
        $('#tabs').tabs({selected:1 });

    }
}

I try to use stopPropagation but it doesn’t work, how can I prevent infinite event occuring ?!

  • 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-11T06:55:21+00:00Added an answer on June 11, 2026 at 6:55 am

    Why don’t you do something like this:

    ...
    select: function(e, ui) {
       var thistab = ui;
       return runMethod();
    }
    ...
    function runMethod(){
        if( $.trim($("#generalImportNo").text()) == "")
        {
           alert("You should fill all main information first.")                     
           return false;
        }
        return true;
    }
    

    If select event returns false then your tab won’t be selected. I can’t test right now, but that’s what I did a long time ago. Also you may find
    $('#tabs').tabs({ disabled: [1, 2, 3], ... }); quite useful, it will prevent your users to click on unavailable tabs. To enable your tab through the code use $('#tabs').tabs('enable', tabIndexToEnable);

    UPD: I created a quick DEMO, seems to work just fine.

    UPD2: Here’s another one just to show that everything works fine.

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

Sidebar

Related Questions

I want to show a alert when user shoots a picture and click on
in my app i want to show an alert message when user has no
I want to show confirmation alert message to user on tap of the image.
when user changes password I want to show message Successfully changed! and when user
I want to show the message which asks the user if he accepts that
I have few questions, I want to show the alert window on my Update
I am creating an extension for Chrome. I want to show an alert() with
i have an alert box which i want to show some icelandic text but
I want to create a simple multiline Alert popup Alert.show(Blah\\nBlah) shows Blah\nBlah when what
hii I want show a pop up Dialog box when i click on 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.