@JOSE

I wrote this code that is working but  I think there is a better way:

$(document).ready(function(){
                                $("#treeform").validate({
                                        errorContainer: $("#messageBox1"),
                                        errorLabelContainer: $("#messageBox1 
ul"),
                                        wrapper: "li",
                                        submitHandler: function(){
                                                $
('.loading').removeClass('loading');
                                                $(this).submit();
                                        }
                                });
                        });

What do you think???

Thanks

Andrea

On 4 sep, 11:07, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi Jose,
>
> You solved again my problem.
> I tried taht before but I made a stupid syntax mistake.....
>
> Thanks
>
> Andrea
>
> On Sep 4, 4:45 am, SeViR <[EMAIL PROTECTED]> wrote:
>
> > 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