Validation plugin has a submitHandler property so:

$('.launch').validate({
                                errorContainer: $("#messageBox1"),
                                errorLabelContainer: $("#messageBox1 ul"),
                                wrapper: "li",
                                submitHandler: function(theform){
                                                
$('.loading').removeClass('hidden');
                                }
                                });


[EMAIL PROTECTED] escribió:
Hi,

I have a function that show a loading bar when a form is submitted:

//show loadind bar
$(document).ready(function(){
        $('.launch').submit(function(){
                $('.loading').removeClass('hidden');
        });
});

Now adding the validation plugin I have an undesired effect:

$(document).ready(function() {
                        $('.launch').validate({
                                errorContainer: $("#messageBox1"),
                                errorLabelContainer: $("#messageBox1 ul"),
                                wrapper: "li",
                                });
                        });

I was sure submit event was fireing only when form was effectivly
submitted and that a false validate should block this effect.
But if I submit and validation show an error the submit event is fired
and loading bar is displayed.
I need to bind the submit event only to the positive response of
validation but I do not find the right syntax.

Any suggestion

Andrea




--
Best Regards,
José Francisco Rives Lirola <sevir1ATgmail.com>

SeViR CW · Computer Design
http://www.sevir.org
Murcia - Spain

Reply via email to