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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:57:08+00:00 2026-05-22T22:57:08+00:00

I have Tab1, Tab2 and Tab3… All tabs have inputs that are validated …

  • 0

I have Tab1, Tab2 and Tab3…
All tabs have inputs that are validated …

My save method validates the required inputs:

var validator = $("form").validate(); // obtain validator
var anyError = false;
$('#tabs').find(":input").each(function ()
{
    if (!validator.element(this)) { // validate every input element inside this step
        anyError = true;
    }
});
if (anyError)
    return false; // exit if any error found

//save ...

Its working fine… But I´d like to select the first Tab that has an “error”… How can I do that?

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-05-22T22:57:09+00:00Added an answer on May 22, 2026 at 10:57 pm

    Untested but could you not do this:

    $('#tabs').find(":input").each(function ()
    {
        if (!validator.element(this)) { // validate every input element inside this step
            anyError = true;
            // trigger click on the tab that is linked to $(this).parents('yourtabcontainername') here
            return false; // ends each
        }
    });
    if (anyError)
        return false; // exit if any error found
    
    //save ...
    

    Alternatively if you want all inputs to be checked regardless you could do something like this:

    var validator = $("form").validate(); // obtain validator
    var anyError = false;
    var firstError;
    $('#tabs').find(":input").each(function ()
    {
        if (!validator.element(this)) { // validate every input element inside this step
            anyError = true;
            if(firstError === undefined){
                //set firstError to reference the tab that is linked to $(this).parents('yourtabcontainername')
            }
        }
    });
    if (anyError) {
            //trigger click on firstError
            return false; // exit if any error found
        }
    
    //save ...
    

    are either of those about what you are looking for?

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

Sidebar

Related Questions

The markup required by jQuery UI Tabs is like following... <ul> <li>Tab1</li> <li>Tab2</li> <li>Tab3</li>
I have following a tags: <a href=#tab1>Any tab1 Label</a> <a href=#tab2>tab2 Label</a> <a href=#tab3>Any
HI, I have a database with 3 tables TAB1, TAB2, TAB3 which have exactly
I have 2 tables: tab1 ( field1, field2, field3 ) tab2 ( field1, field2,field3,
I have an oracle sql query select distinct tab1.col1, tab2.col1 from table1 tab1 join
I have a unordered list like the one below: <ul id=tabs> <li><a href=#tab1>latest news</a></li>
I have a site with three tabs that I'm trying to dynamically add mouseover/mouseout
I have a UL list in a ASPX page: <ul id=tabs> <li id=tab1><a href=ztab1.htm>Tab
I have a tab panel like this: var tab1 = { id: 'section1', title:
I have a tab panel like this: var tab1 = { id: 'section1', title:

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.