Perhaps I could use the depends parameter (http://dev.jquery.com/ ticket/2456) in order to check what page I'm on and therefore validate accordingly for only the visible page.
There are several other options I've thought through (including actually going with the real estate example above, which would involve reinventing the wheel in several places where cannot use the validation plugin for error display, etc.), but I'm looking for the best recommended solution. Thanks in advance for any pointers! On Oct 20, 12:32 pm, ovalsquare <[EMAIL PROTECTED]> wrote: > I am attempting to paginate a form, and validate for each page (page > navigation via accordion or simply .show()/.hide()). However, the only > sample I've seen of this appears to be the Help me Buy and Sell a > House demo athttp://jquery.bassistance.de/validate/demo/multipart/. > This sample requires that a "pageRequired" method be added as follows: > > $.validator.addMethod("pageRequired", function(value, element) { > var $element = $(element) > function match(index) { > return current == index && $(element).parents("#sf" + > (index + > 1)).length; > } > if (match(0) || match(1) || match(2)) { > return !this.optional(element); > } > return "dependency-mismatch"; > }, $.validator.messages.required) > > var v = $("#cmaForm").validate({ > errorClass: "warning", > onkeyup: false, > onblur: false, > submitHandler: function() { > alert("Submitted, thanks!"); > } > }); > > I would much prefer to take my existing setup with custom validation > messages for each field, as well as the ability to use per field > specific validation (i.e. email, maxLength, custom addMethods, etc.), > as in the following: > > // Validation > var container = $("#myForm div.validationSuggestion"); > > $('#myForm').validate({ > errorContainer: container, > errorLabelContainer: $("ul",container), > rules: { > someField: { required: true }, > someOtherField: {required: true, maxLength:20 } > //many other fields. > }, > messages: { > someField: 'Error message for someField.', > someOtherField: 'Another specific error message.' > // many other fields. > }, > highlight: function(element, errorClass) { > $(element).addClass(errorClass); > $(element.form).find("label[for=" + element.id + > "]").addClass(errorClass); > $(element.form).find("label[for=" + element.id + > "]").removeClass("valid"); > }, > unhighlight: function(element, errorClass) { > $(element).removeClass(errorClass); > $(element.form).find("label[for=" + element.id + > "]").removeClass(errorClass); > $(element.form).find("label[for=" + element.id + > "]").addClass("valid"); > }, > wrapper: 'li' > }); > > I cannot have multiple forms (I only want to submit on the last page). > Am I missing something obvious?