victorjonsson / jQuery-Form-Validator

[DISCONTINUED] jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code.
972 stars 476 forks source link

focuscleanup how can i do that ? #347

Open ugurtasar opened 8 years ago

ugurtasar commented 8 years ago

Hello,

How can i use focuscleanup ?

Here is my codes:

$.validate({
        //validateOnBlur : false, 
        //showHelpOnFocus : true,
        //addSuggestions : false,       
        modules : 'security',
        onError : function($form) {
          alert('form error!');       
        },
        onElementValidate : function(valid, $el, $form, errorMess) {
            //console.log('Input ' +$el.attr('name')+ ' is ' + ( valid ? 'VALID':'NOT VALID') );
        },
        onSuccess : function($form) {
            alert('form başarılı!');
            return false;
        },      
        onValidate : function($form) {
         //$('.mainform form').get(0).reset();            
        },
    });
victorjonsson commented 8 years ago

Could you please explain what you mean by "focuscleanup"?

ugurtasar commented 8 years ago

For example:focusCleanup (default: false)Type: BooleanIf enabled, removes the errorClass from the invalid elements and hides all error messages whenever the element is focused. Avoid combination with focusInvalid.Example: Enables cleanup when focusing elements, removing the error class and hiding error messages when an element is focused.123$(".selector").validate({ focusCleanup: true}); here is my page: (mailed to you) If i was clicked another input; error message still displaying,

Thank you,

victorjonsson commented 8 years ago

I've sent you a quick fix (for your certain use case) via email.

This is however not generally support.