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

Submit button is getting disabled without using toggleDisabled module #686

Closed dipak4github closed 6 years ago

dipak4github commented 6 years ago

Submit button is getting disabled initially even though i haven't included the toggleDisabled module. Please help

var _config = { lang : 'fr', form: '#orderForm', modules : 'security', validateOnBlur : false, / disable validation when input looses focus/ scrollToTopOnError : false, // Set this property to true if you have a long form

    onSuccess: function() {   
        let is_product_selected = _is_Quantity_Selected();  
        if(!is_product_selected){

            $('<p class="text-danger">* Atleast selectionner un produit avant de passer la commande.</p>').insertAfter('#order-heading'); 
            $('html, body').animate({
                scrollTop:0
            },'slow');  
            return false;
        }
        //console.log('valid'); 
    }, 
    onError: function($form) {
        if($('#orderForm .has-error').length > 0){
            var position = $('.has-error').offsetTop;
            $('html, body').animate({
                scrollTop:(position)
            },500);  
        }  
    },

    onElementValidate : function(valid, $el, $form, errorMess) {
        //console.log('validating'+valid); 
    }     
}; 
$.validate(_config);