Maybe not the solution you're looking for, but easy enough to give it a try: By adding a class of "cancel" to a "save anyway"-submit-button, the validation is skipped and the form submitted.
Jörn On Fri, Nov 13, 2009 at 7:45 AM, Jim Biancolo <j...@biancolo.com> wrote: > Hi folks, > > Short version: is there code I can put in invalidHandler that will > allow the submit to proceed, even if there are validation errors in > the form? (note that form.submit() does not seem to be the answer) > > Long version: I have a situation where my client wants all the visual > validation cues, but still wants the user to be able to submit an > "invalid" form so that it can be saved to the database to be resumed > later. I'm struggling with this using the validation plugin, as it > doesn't want to allow the submit to happen if there are any validation > errors. Is there a way to force it to proceed? I thought this bit > from the "too much recursion" section of the help would do it: > > $("#myform").validate({ > submitHandler: function(form) { > form.submit(); > } > }); > > I figured if form.submit() could be called from submitHandler, then it > could also be called from invalidHandler, but it doesn't appear so. I > get a Firebug error telling me form.submit() doesn't exist. Now, as > it happens, the submit rams through anyway, which I could live with, > but having this code here causes other problems, like when I call > validator.form() I get the same undefined error, and it prevents all > subsequent validations from happening. > > Any ideas? > > Thanks! > > Jim >