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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:21:01+00:00 2026-06-18T09:21:01+00:00

hi i have three tabs in jquery, i want to disable the second and

  • 0

hi i have three tabs in jquery,

i want to disable the second and the third tab if the below two fields are selected the option “No” which is on the first tab.

<!--    Chest compressions performed    -->
<tr id="ContainerQ110I1039">
    <td>Chest compressions performed&nbsp;</td>
    <td><select name="Q110I1039" id="Q110I1039">
            <option value=""  ></option>
            <option value="0"  >No</option>
            <option value="1"  >Yes</option>
        </select>
    </td>
 </tr>
<!--    Defibrillation delivered    -->
<tr id="ContainerQ111I1040">
    <td>Defibrillation delivered&nbsp;</td>
    <td><select name="Q111I1040" id="Q111I1040" >
            <option value=""  ></option>
            <option value="0"  >No</option>
            <option value="1"  >Yes</option>
        </select>
    </td>
 </tr>

The below are the tabs

<ul class='tabs'>
 <li><a href='#tab1'>2222 calls</a></li>
 <li><a href='#tab2'>Cardiac Arrest</a></li>
 <li><a href='#tab3'>Outcome </a></li>
</ul>

the below is the jquery so far

<script language="javascript">
        // Wait until the DOM has loaded before querying the document
        $(document).ready(function(){
            $('ul.tabs').each(function(){
                // For each set of tabs, we want to keep track of
                // which tab is active and it's associated content
                var $active, $content, $links = $(this).find('a');

                // If the location.hash matches one of the links, use that as the active tab.
                // If no match is found, use the first link as the initial active tab.
                $active = $($links.filter('[href="'+location.hash+'"]')[0] || $links[0]);

                $active.addClass('active');
                $content = $($active.attr('href'));

                // Hide the remaining content
                $links.not($active).each(function () {
                    $($(this).attr('href')).hide();
                });

                // Bind the click event handler
                $(this).on('click', 'a', function(e){
                    // Make the old tab inactive.
                    $active.removeClass('active');
                    $content.hide();

                    // Update the variables with the new link and content
                    $active = $(this);
                    $content = $($(this).attr('href'));

                    // Make the tab active.
                    $active.addClass('active');
                    $content.show();

                    // Prevent the anchor's default click action
                    e.preventDefault();
                });


            });
        });
    </script>

Many thanks

  • 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-18T09:21:02+00:00Added an answer on June 18, 2026 at 9:21 am

    Using jQuery you could maybe implement something like this:

    $("select").change(function () {
        if ($("#Q110I1039").find(":selected").text() == "No" && $("#Q111I1040").find(":selected").text() == "No") {
            $(".tabs li").not(":first-child").find("a").addClass("disabled");
        }
    });
    

    What we do here is that each time we select an answer we check if both answers are set to NO. If it is the case we add to all the tabs, except for the first one, the class disabled.

    Then we add this code to “block” the tabs:

    $(document).on("click", ".disabled", function () {
        return false;
    });
    

    so that if you click on them nothing happens.

    Here is a DEMO

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

Sidebar

Related Questions

I have a jquery tab container, in which there are two tabs. Now what
I want to make jQuery UI TAB blink (like notification). I have diffrent tabs
Suppose i have some tabs (e.g. jquery tab) and I want to dynamically load
I have set of Jquery-UI-Tabs which contains a save button for each tab. I
I have jQuery tab, it works perfectly, I want to make the tabs to
I am using jquery UI tabs I have three ajax tabs like so: <div
I have three tabs. When I press the tab button on the bottom, is
I have a TabActivity with three tabs defined. The first tab is light-weight and
Within my iPhone application I have a common tab bar with three tabs that
I use jQuery 1.7.2 and UI 1.8.21 with tabs plugin. I have three tabs

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.