Thanks, Jorn... I'll check it out. Rick
> -----Original Message----- > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On > Behalf Of Jörn Zaefferer > Sent: Tuesday, December 23, 2008 9:42 AM > To: jquery-en@googlegroups.com > Subject: [jQuery] Re: [validate plugin] How to call a function before the > validation start? > > The option you are looking for is called "submitHandler". Details > here: http://docs.jquery.com/Plugins/Validation/validate#toptions > > Jörn > > On Tue, Dec 23, 2008 at 11:43 AM, Giovanni Battista Lenoci > <gian...@gmail.com> wrote: > > > > Hi, I'm using the validate plugin, I have a comment form where I want to > > leave the possibility to insert an anonymous comment, but I want to alert > > the user before the submit. > > > > Then, if I have this code, what I have to do, to add a confirm('Are you > > sure')? > > I'm looking for a method like "onBeforeSubmit" :-) > > > > Thank you. > > > > if($('#commenti_form').size() > 0) { > > $("#commenti_form").validate({ > > invalidHandler: function(form, validator) { > > var errors = validator.numberOfInvalids(); > > if (errors) { > > $("div#error_container").show(); > > } else { > > $("div#error_container").hide(); > > } > > }, > > onfocusout: false, > > onkeyup: false, > > onclick:false, > > meta: "validate", > > errorClass: "invalid", > > errorPlacement: function(error, element) { > > $labelToAppendTo = $('label[for='+element[0].id+']'); > > > > error.appendTo($("div#error_container")).clone().appendTo($labelToAppendTo); > > $('<br />').appendTo($("div#error_container")); > > } > > }); > > } > > > > > > -- > > gianiaz.net - web solutions > > via angelo custode, 10 - 23100 sondrio (so) - italy > > +39 347 7196482 > >