slakoz wrote:
What is wrong:
the validation is working, because the message for Field1 validation
is displaying, but i can't figure out why the form is submited and
tab#2 enabled and triggered, when validation for Form1 in Tab1 is
unsuccessfull.

The validate-plugin-method returns the validator object it creates. To actually perform the validation you need to call it's form method, eg. $("...").validate().form();

I'd recommend a different approach:

$("#dane_zam").validate({
 rules: {...},
 messages: {...},
 submitHandler: function(form) {
   $(form).ajaxSubmit({
     target: "#result_danem_zam",
     success: function() {
       $("...").triggerTab...
     }
 }
});

I still have to investigate how to properly perform validation when using ajaxForm. Something like this may work:

var form = $("...");
var validator = new jQuery.validator({
 rules: {...},
 messages: {...}
}, form[0]);
form.ajaxForm({
 beforeSubmit: function() {
   return validator.form();
 }
});

--
Jörn Zaefferer

http://bassistance.de

Reply via email to