To fix this, you have to bind a click-handler to the submit-button and manually add it's name-value-pair to the ajaxSubmit, as data or by creating a hidden input.
I'm looking into covering this inside the validation plugin, so you don't have to worry about it, but it's not trivial to cover all the situations that are possible when using submitHandler. Jörn On Thu, Feb 19, 2009 at 7:45 PM, Ted <tberger...@gmail.com> wrote: > > I have a simple form with submit and cancel buttons. Standalone > everything works great. With the basic validator added, it also works > great, cancel is recognized and validation is skipped. > > When the submitHandler is added validation works, but all the data > EXCEPT for the cancel (_cancel=Cancel) is POSTed. This is the case > whether I use either "form.submit()" or the ajaxSubmit. > > I am using jQuery 1.3.1 and validation 1.5.1. (Form library is the > version bundled with validation 1.5.1) > > ---------------------- > > <div> > <input id="save" type="submit" value="Save"/> > <input id="cancel" type="submit" class="cancel" value="Cancel" > name="_cancel"> > </div> > > <script type="text/javascript"> > $(document).ready(function() { > $("#formId").validate({ > debug: true, > > submitHandler: function(form) { > form.submit(); > /* > $(form).ajaxSubmit(function() { > alert("Thank you for your comment!"); > }); > */ > } > }); > }); > </script> > > ---------------------- > > > >