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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:55:10+00:00 2026-06-06T23:55:10+00:00

I have buttons that trigger jQuery validation. If the validation fails, the button is

  • 0

I have buttons that trigger jQuery validation. If the validation fails, the button is faded to help draw attention away from the button to the validation messages.

$('#prev,#next').click(function (e)
{
    var qform = $('form');
    $.validator.unobtrusive.parse(qform);
    if (qform.valid())
    {
        // Do stuff then submit the form
    }
    else
    {
        $('#prev').fadeTo(500, 0.6);
        $('#next').fadeTo(500, 0.6);
    }

That part works fine.

However, I would like to unfade the buttons once the invalid conditions have been cleared.

Is it possible to hook into jQuery Validation to get an appropriate event (without requiring the user to click a button)? How?

Update

Based on @Darin’s answer, I have opened the following ticket with the jquery-validation project

https://github.com/jzaefferer/jquery-validation/issues/459

  • 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-06T23:55:11+00:00Added an answer on June 6, 2026 at 11:55 pm

    It might sound you strange but the jQuery.validate plugin doesn’t have a global success handler. It does have a success handler but this one is invoked per-field basis. Take a look at the following thread which allows you to modify the plugin and add such handler. So here’s how the plugin looks after the modification:

    numberOfInvalids: function () {
        /* 
        * Modification starts here...
        * Nirmal R Poudyal aka nicholasnet
        */
        if (this.objectLength(this.invalid) === 0) {
            if (this.validTrack === false) {
                if (this.settings.validHandler) {
                    this.settings.validHandler();
                }
                this.validTrack = true;
            } else {
                this.validTrack = false;
            }
        }
        //End of modification 
    
        return this.objectLength(this.invalid);
    },
    

    and now it’s trivial in your code to subscribe to this event:

    $(function () {
        $('form').data('validator').settings.validHandler = function () {
            // the form is valid => do your fade ins here
        };
    });
    

    By the way I see that you are calling the $.validator.unobtrusive.parse(qform); method which might overwrite the validator data attached to the form and kill the validHandler we have subscribed to. In this case after calling the .parse method you might need to reattach the validHandler as well (I haven’t tested it but I feel it might be necessary).

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

Sidebar

Related Questions

I have a variety of anchor tags and input buttons that trigger a variety
I have some dynamic buttons that look like this: <input type=button name=button id=button value=Click
Possible Duplicate: jquery trigger - ‘change’ function I have a radio button set called
I have a jQuery AJAX data grid that loads a list of elements from
I have a form that uses jQuery Validate. You click the Submit button, form
I have a form with multiple buttons, sliders, etc. that all trigger a main
I want to have buttons that kind of act like tabs - they switch
I have two buttons that moves a movieclip up/down the Y-axis. How do I
I have multiple buttons that gets created in a table which all look like
I have ten buttons that each correspond to a different number. I'm looking to

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.