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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:42:36+00:00 2026-05-26T19:42:36+00:00

I am using the jquery validation plugin to validate a form. I have the

  • 0

I am using the jquery validation plugin to validate a form. I have the form broken up into tabs and you are only able to navigate to the next tab when you click the next button. Durring the onclick event for that next button I would like to make sure the current tab has no errors.

The tabs are marked by a class form_group. A default tab html looks like:

<div id="tab-1" class="form_group">
    <div>
      <label for="name">Your Name:</label>
      <input id="ins_name" type="text" name="name"  maxlength="40" />       
    </div>

    <a class="next-tab mover" rel="2" href="#">Next Step »</a>
</div>

Once it is validated by a onfocusout event the input is given a class of either “valid” or “error”

I have tried numerous methods to try and find out when clicking on that next tab button whether or not the current tab has an input with the class “error” but have not been able to figure that out.

Here is my latest try.

 $('.next-tab, .prev-tab').click(function() {
    if ($(this).find('input.error')) {
               alert('error present');
               return false;
    }

    $tabs.tabs('select', $(this).attr("rel"));
       return false;
 });

Can anyone help me out with telling if a div has an input with that error. One of my problems is that $this is using the .next-tab element. I have tried to select the closest “form_group” class with no luck either.

  • 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-26T19:42:36+00:00Added an answer on May 26, 2026 at 7:42 pm

    It helps if you post the current, undesirable behaviour of the script (e.g. it changes tabs even when there are errors/it never changes tabs even when the fields are valid).

    Anyway, I believe you want something like this:

    $('.next-tab, .prev-tab').click(function(e) {
    
      if ($('.form_group input.error').length > 0) {
        alert('error present');
        e.preventDefault();
      }
    

    Note that .preventDefault() is generally preferred over return false for preventing the default behaviour of an event:

    http://fuelyourcoding.com/jquery-events-stop-misusing-return-false/

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

Sidebar

Related Questions

I am using JQuery validation plugin to validate my form. I have a radio
I'm using the jQuery plugin Validation to validate a form. I have a select
I'm using the jQuery validation plugin found here: http://plugins.jquery.com/project/validate In my form I have
I am using jquery validation plugin for form validation. I have added a custom
I am using jquery validation plugin to validate a registration form. Each text input
I am using the jQuery Validation plugin to validate a signup form for my
I'm using jQuery validation plugin to validate a form. when one thing is selected
I am using jQuery validation plugin to validate my form, but it is seems
I'm using the jQuery validation plugin to validate a form. The form fields are
I am using Inline Form Validation Engine 1.6.2, jQuery plugin to validate form. But

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.