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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:33:36+00:00 2026-06-09T08:33:36+00:00

I am currently working with Jquery UI tabs and dynamic select boxes. I am

  • 0

I am currently working with Jquery UI tabs and dynamic select boxes. I am currently trying have the buttons disabled until user selects and item from the select box . Is it possible/How can get the user to first click on an item in the select box before advancing to the next tab? I dont have anything that I can build from but here is my EXAMPLE so far.

JS- For previous/next button

   <script>
            $(function() {

                var $tabs = $('#tabs').tabs();

                $(".ui-tabs-panel").each(function(i){

                  var totalSize = $(".ui-tabs-panel").size() - 1;

                  if (i != totalSize) {
                      next = i + 2;
                      $(this).append("<a href='#' class='next-tab mover' rel='" + next + "'>Next Page &#187;</a>");
                  }

                  if (i != 0) {
                      prev = i;
                      $(this).append("<a href='#' class='prev-tab mover' rel='" + prev + "'>&#171; Prev Page</a>");
                  }

                });

                $('.next-tab, .prev-tab').click(function() { 
                       $tabs.tabs('select', $(this).attr("rel"));
                       return false;
                   });


            });
    </script>

PHP/HTML

<select name="gender" id="gender" class="update" size="7"> 
        <option value="">Select one</option> 
            <?php if (!empty($list)) { ?> 
                <?php foreach($list as $row) { ?> 
                    <option value="<?php echo $row['id']; ?>"> 
                        <?php echo $row['category_name']; ?> 
                                </option> 
                            <?php } ?> 
                        <?php } ?> 
</select> 

<select name="category" id="category" class="update" disabled="disabled" hidden="hidden" size="7"> 
        <option value="">----</option> 
</select> 

<select name="colour" id="colour" class="update" disabled="disabled" hidden="hidden" size="7"> 
        <option value="">----</option> 
</select> 
  • 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-09T08:33:37+00:00Added an answer on June 9, 2026 at 8:33 am

    There are some solutions (with the 2nd solution you can nevertheless change the tab without clicking the next button).

    1.) You can disable the second tab ($('#tabs').tab({ disabled: [1] });) and enable the tab, if an option is selected e.g. by adding following change handler:

    $('#gender').change(function() {
        $('#tabs').tabs(
            'option',
            'disabled',
            (parseInt($(this).val(), 10) > 0 ? [] : [1])
        );
    });
    

    Also see this example.

    2.) You can update your next click handler; change the tab only if a gender is choosen:

    $('.next-tab, .prev-tab').click(function() {
        if (parseInt($('#gender').val(), 10) > 0) {
            $tabs.tabs('select', $(this).attr("rel"));
        }
        return false;
    });
    

    Also see this example.

    3.) Add a tab select handler, which returns false, if the user is on the first tab and no gender is choosen; add an object as tab parameter with a tab select handler:

    var iOldTab = 0;
    var $tabs = $('#tabs').tabs({
        select: function(event, ui) {
            var bChange = (iOldTab != 0 || parseInt($('#gender').val(), 10) > 0);
            if (bChange) {
                iOldTab = ui.index;
            }
            return bChange;
        }
    });
    

    Also see this example.


    Finally I prefer the first solution because the user can see that the second tab can’t be reached (until he choose a gender) and the result of choosing (enabling the tab) will be shown immediately.

    === UPDATE ===

    Ok, if you have different numbers of selects (deppending on the values of the previous selects), here an alternative (untested) solution:

    1.) Replace the content of the jQuery.getJSON in the updateSelectBox.js (the really last select will be marked):

    // following line is added
    $('.update').removeClass('last');
    if (!data.error) {
        obj.next('.update').html(data.list).removeAttr('disabled hidden');
    } else {
        // following line is changed
        obj.addClass('last').nextAll('.update').attr({'disabled': true, 'hidden':true}).html('<option value="">----</option>');
    }
    

    2.) Call the tab with disabled tab 2

    $('#tabs').tab({ disabled: [1] });
    

    3.) Add following select change handler:

    $('.update').change(function() {
        $('#tabs').tabs(
            'option',
            'disabled',
            (
                $(this).hasClass('last') &&
                parseInt($(this).val(), 10) > 0 ?
                [] :
                [1]
            )
        );
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with dynamic tabs in jQuery . When the user opens a
I am currently working on rails3 application that uses jQuery. I have a javascript
I'm currently working on a webproject. I have to use a carousel Jquery, found
currently I have a section of my page with jquery tabs. The tabs reference
I'm currently working with jQuery and using the datepicker. I have two input fields:
I am currently working on a html5 and jquery project. I have an html5
I am currently working with jquery ui tabs but I am facing some issues
I'm currently working with jQuery 1.4.2 and jQuery UI 1.8.2. I'm experiencing some weird
I'm currently working on a jQuery script that will translate the site's text into
I am currently working with the jQuery validation plugin , and 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.