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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:13:48+00:00 2026-06-14T06:13:48+00:00

I have a form divided into three tabs and validate it with jQuery validation

  • 0

I have a form divided into three tabs and validate it with jQuery validation plugin. User can switch between tabs with links. After submit button is pushed and validation failed, error class is being added to links which corresponding tabs/containers has errors. This made with next function:

function treatFormLinks () {
    $('.formTab').each(function(){
        $("#" + this.id + "Link").toggleClass('hasErrors', !$('input, select, textarea', this).valid());
    });     
};
$("#Submit").click(function () {
    $('.FormNavi a').removeClass('hasErrors');
    treatFormLinks();
});

Here’s html example, just to explain the idea how it works:

<a href="#" id="OneLink">Link 1</a>
<a href="#" id="OneLink">Link 2</a>
<a href="#" id="OneLink">Link 3</a>

<form>
    <div class="formTab" id="One">... form fields ...</div>
    <div class="formTab" id="Two">... form fields ...</div>
    <div class="formTab" id="Three">... form fields ...</div>
</form>

What I need is to find first div, which contains invalid fields and the show this one. Let’s say #One and #Three divs’ fields are valid and div #Three is visible. What I want is to show #Two after pushing submit button.

Thank you!

  • 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-14T06:13:50+00:00Added an answer on June 14, 2026 at 6:13 am

    Show the div right after you set the link.

    function treatFormLinks () {
        var alreadydisplayed = false;
        $('.formTab').each(function(){
            $("#" + this.id + "Link").toggleClass('hasErrors', !$('input, select, textarea', this).valid());
            alreadydisplayed?void(0):$(this).css("display","");//if an invalid tab has already been displayed, do nothing
            alreadydisplayed = true;
        });     
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form whitch divided into a few divs . I use jquery
I have form where user submits field. Field can have letters, numbers, and punctuation.
I have a form that is divided into two classes. Each class represents the
I do have a credit card number form. The number is divided into four
I have a complex form to layout.Assume screen is equally divided into two parts
I have form, where some fields are looks like rows, so I can add/delete
i have form with user data to input and javascript ajax to send information
My questions are divided into three parts Question 1 Consider the below code, #include
I have a form with over 50 input fields. The input fields are divided
I have my system divided into 2 parts. Both parts communicate with each other

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.