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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:53:58+00:00 2026-05-25T22:53:58+00:00

im up to apply jquery UI tabs to my application and im going to

  • 0

im up to apply jquery UI tabs to my application and im going to apply jquery validation class on that. my problem is if i got error in some div that div should selected and display the error to user when click on the save button .

i tried

 $('#tabs > div').each(function(i){
                   if($('.errortd', this).not(':hidden').length>0){
                                $("#tabs").tabs('select', i);                                              

                      });

               });

But i have no luck any help thanks lot

my tabs div

    <div id="tabs">
           <ul>
            <li><a href="#editEmployeeDIV"><?php echo __("View/Edit employees") ?></a></li>
            <li><a href="#addEmployeeDIV"><?php echo __("Assign new employees") ?></a></li>
           </ul>
    <div id="editEmployeeDIV">
    </div>
    <div id="editEmployeeDIV">
    </div> 
</div>

my error lables having class errortd

<label for="txtAmount_146" generated="true" class="errortd" style="display: none; ">This field is required.</label>
  • 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-25T22:53:59+00:00Added an answer on May 25, 2026 at 10:53 pm

    You have a few problems.

    The first is a stray ); in your code:

    if($('.errortd', this).not(':hidden').length>0){
        $("#tabs").tabs('select', i);                                              
    }); // <------ Right here
    

    Then you’re using :hidden when you shouldn’t be. From the fine manual:

    Elements can be considered hidden for several reasons:
    […]

    • An ancestor element is hidden, so the element is not shown on the page.

    That means that the <label> will always be considered hidden if it is in a non-current tab.

    You could do something like this:

    var $shown = $(this).find('.errortd').filter(function() {
        var dpy = $(this).css('display');
        return !dpy || dpy != 'none';
    });
    if($shown.length > 0)
        $("#tabs").tabs('select', i);
    

    Demo: http://jsfiddle.net/ambiguous/agrCe/

    Or, add a class to the <label> elements that hides them instead of manually hiding them. You have a bit of CSS like this:

    .no-error {
        display: none;
    }
    

    And then:

    if($(this).find('.errortd:not(.no-error)').length > 0)
        $("#tabs").tabs('select', i);
    

    Demo: http://jsfiddle.net/ambiguous/Z4D2A/

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

Sidebar

Related Questions

How to apply jquery accordion function to a div with a particular class... i.e.
Problem: When using jQuery Tabs in AJAX mode, I load an .html file that
<div class=test> <div class=example></div> </div> <div class=test> </div> How can I apply jQuery to
I am trying to apply the following jQuery click function but for some reason
how can I apply a jquery function to elements that are loaded with ajax?
I'm using jQuery UI tabs(). It adds ui-tabs-selected to the selected LI, but each
I'm trying to apply jquery functions to a drop down menu and for some
I've just got interested in jQuery UI Button widget. So in order to apply
I have an application that's running Knockout with a few jQuery plugins, the one
I use jquery ui to apply a drag and drop effect on a serial

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.