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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:32:06+00:00 2026-06-17T21:32:06+00:00

With validation 1.8, I used a $.blur function on all the form’s input elements

  • 0

With validation 1.8, I used a $.blur function on all the form’s input elements to trigger validation on that field when the user tabs out:

$('#myform :input').blur(function() {
    $("#myform").validate().element( this );
});

Which worked great. However I just updated to 1.9 and now my fields are validating on keyup instead of blur.

I didn’t change anything with my setup, just switched to 1.9.

I see there have been a lot of changes, but I don’t see additional documentation.

Any help would be appreciated.

Clarification

prior, my elements would initially validate on blur, but if an element was in an error state, the element would actively validate on keyup, etc. if a user went back in to make a change. This is my desired behavior. That on initial entry, there is no active validation until on blur, but once a field is in an error state the field should actively validate on change, keyup, etc.

Now, the element is validating on keyup on initial entry

  • 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-17T21:32:07+00:00Added an answer on June 17, 2026 at 9:32 pm

    By default, for text input, jQuery Validate is triggered on “blur” (onfocusout:), “keyup” (onkeyup:) and “submit” (onsubmit:) events.

    To have it only validate fields on “blur” and “submit”, simply set onkeyup: option to false…

    $(document).ready(function() {
    
        $('#myform').validate({
            onkeyup: false, // to use onkeyup, remove this line
            // other rules and options
        });
    
    });
    

    All versions work the same…

    Working Demo (v1.10): http://jsfiddle.net/M2MLL/

    Working Demo (v1.9): http://jsfiddle.net/KSgLb/

    Working Demo (v1.8): http://jsfiddle.net/k87Lp/

    The default behavior for onfocusout is such that validation on the field will only start to occur after something has been left in the field (or after the initial submit event), otherwise simply leaving the field empty and clicking away to a new field does nothing.


    If you want validation to occur on “blur” every single time, no matter what, just modify the callback function for onfocusout: like this…

    $(document).ready(function() {
    
        $('#myform').validate({
            onfocusout: function(element, event) {
                this.element(element);
            },
            onkeyup: false,
            // other rules and options
        });
    
    });
    

    Working Demo (v1.9): http://jsfiddle.net/eRNTu/

    Version 1.10 also working: http://jsfiddle.net/Mev8v/


    BTW: Although I wouldn’t do this with .blur(), your original code was working fine with v1.9 and v1.10. However, I believe that leveraging the internal functionality of the plugin’s onfocusout: option is a much more robust way to achieve your goal.


    EDIT 2:

    In response to OP’s last clarification:

    “That on initial entry, there is no active validation until on blur, but once a field is in an error state the field should actively
    validate on change, keyup, etc.”

    Here is a new working demo which modifies the default callback function for onkeyup:

        onkeyup: function (element, event) {
            if (event.which === 9 && this.elementValue(element) === '') {
                return;
            } else if (element.name in this.submitted ) {
                this.element(element);
            }
        },
    

    The field will ignore any onkeyup validation initially or when no error is being shown. Only when there is an active error and the user goes back to the field will onkeyup validation start to operate.

    Working Demo: http://jsfiddle.net/6s4rj/

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

Sidebar

Related Questions

jQuery Validation plugin is used to validate all form data: http://docs.jquery.com/Plugins/Validation Have 3 select
When I used datepicker with trigger icon so that users could choose date from
Has any one used data validation on fields that are optional (nullable types)? I.e.
I have a control template defined, call it myVal, that is used for validation
I have developed one login form in Android. I have used validation here. I
Can anyone give the complete form validation classes used in magento?
I am using javascript for required field validation,i have used alert box,after clicking ok
In codeigniter I have used codeigniter form validation library in many controller, ex: -
I'm working on form validation and I have used Vtypes to check number ranges.
I have coded custom form validation. validation is working fine all browser but when

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.