I've used Jörn Zaefferer's plugin titled "Form Validation (no Ajax)" on 
the plugins page for normal form submission -- nicely done.

I assumed that the "no Ajax" meant you didn't have to get your 
validation rules from the server. But now I find I can't make it work 
*with* Ajax submission ($.getJSON). So maybe "no Ajax" means "no Ajax" :-)

But, just in case, is there a way to do a validation on click , then 
submit depending on the results? Here's an approach that does not work:
------------
$( document ).ready(function(){
     $("#form1").validate();
    // return false; if this line is uncommented,
    // the form will submit, but not  validate
     $('[EMAIL PROTECTED]').click(
           function(){
               var pars=$( '#form1' ).fastSerialize();
               $.getJSON(
                  'some/app.cgi',
                  pars,
                  function(ret){
                     alert(ret.someVal);
                  }
               );
               return false
            });
});
Thx,

Bruce



-- 
Bruce McKenzie
http://www.2MinuteExplainer.com

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to