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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:05:47+00:00 2026-05-23T05:05:47+00:00

Good morning I have been using the jquery validate function for a while and

  • 0

Good morning

I have been using the jquery validate function for a while and it’s great. However, wondering if its possible to have the group error label only clear out once BOTH (or 3 or 4) elements in the group are correct. For example, if I have an empty first and last name in a group, the error goes away once I type in just the first name. I know I can disable the onfocusout function, but I would rather not. 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-05-23T05:05:48+00:00Added an answer on May 23, 2026 at 5:05 am

    This does indeed look like a bug in jQuery validate (you could file a bug here). To get around it you could define a very specific custom rule:

    $.validator.addMethod("name", function(value, element) {
        return $("#firstname").val() !== '' && $("#lastname").val() !== '';
    }, "Name is required");
    

    And still use the groups functionality:

    $("form").validate({
        groups: {
            name: "firstname lastname"
        },
        firstname: "name",
        lastname: "name",
        errorPlacement: function(error, $element) {
            var name = $element.attr("name");
            if (name === "firstname" || name === "lastname") {
                error.insertAfter("#name");
            } else {
                error.insertAfter($element);
            }
        }
    });
    

    The custom rule feels unmaintainable and hacky, since if your field ids change, your validation will break. However, it does get rid of the problem.

    Here’s an example: http://jsfiddle.net/Rqbws/

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

Sidebar

Related Questions

Good morning, I have problem with using MasterPage and jQuery. I using jQuery UI
Good Morning, I have got the following function: FUNCTION queryDatabaseCount(sqlStr) SET queryDatabaseCountRecordSet = databaseConnection.Execute(sqlStr)
Good Morning All, I have code similar to the following try{ using(var tx =
Good Morning All! I have been developing a project for some time in which
Good morning!! I have a dynamic datatable and I'm using Columns of Richfaces, but
Good morning I have been running a few tests over the past couple of
Good Morning, I have a SharePoint site that I've been trying to fix up
Good Morning Stack OverFlow enthusiasts. I have been having an issue that I am
Good Morning All. I've been struggling with this issue for a while now, and
Good morning, I am taking over from someone who has been using the Entity

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.