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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:11:55+00:00 2026-06-03T22:11:55+00:00

Using jQuery validation – validating on blur: $(‘input, select, radio, checkbox’).blur(function(){ $(#createAccount).validate().element(this); }); If

  • 0

Using jQuery validation – validating on blur:

$('input, select, radio, checkbox').blur(function(){
        $("#createAccount").validate().element(this);
});

If a user is tabbing through the form, and the field is optional, the field is validated as ok (and a class is added, changing the color etc. of the input field)

What I would like to do is to ignore validation for an empty field not required.

My current ignore is only for :hidden

ignore: ":hidden",

and when I tried:

ignore: ":hidden, .ignore",

this would throw an error on when any field was focused that had the class ignore. So that almost works, except if you ignore the field then the other validations on that field don’t trigger. So the field is optional, but there are still validations on it. I just don’t want it to trigger the success validation on an empty optional field.

thanks!

Edit

So the logic should be: onblur if empty and not required then ignore – if not empty then run the validations attached to that field.

  • 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-03T22:11:57+00:00Added an answer on June 3, 2026 at 10:11 pm

    This is what I did to accomplish this:

    For an input that needed to be ignored until it had a value I added a class to the input – “ignore”

    $('.ignore').blur(function(){
            if( $(this).val()=="") {
             $(this).parent().removeClass("inputSuccess");
            }
        });
    

    In the function, if an input has the class ignore and no value has been entered, then I remove the valid class I set in the validate call. When a value is entered, the normal validations will trigger on those items.

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

Sidebar

Related Questions

Using jquery validation: http://docs.jquery.com/Plugins/Validation I am also validating each field on blur: //validate each
I am using jquery validation plugin to validate a registration form. Each text input
I want to add a custom function using jquery validation framework, to help validating
I am using JQuery validation plugin to validate my form. I have a radio
I'm using jQuery validation to validate a form with a radio button set on
I'm using JQuery Validation to validate a particular textbox in my form. The textbox
I'm using the jQuery validation plugin. On most of my input type... tags I
I am using jquery validation plugin to validate my form. I have one field
I am validating form using jquery validation plugin...... rules: { Name: required, MobileNo: {
I am using jquery validation for required field vaidation. $(#registerform).validate(); This fires for the

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.