[jQuery] Re: validate on ajaxform
Well I can't tell if you're trying to use the validation plugin or not. I don't see any calls to the validate method on your page anymore. But if you're not using it then you need to change how you're using ajaxForm. If you pass just a function to ajaxForm then that function becomes the success handler and will be invoked when the server response is received. If you need to do some minor validations then you must pass an object to the ajaxForm method. Something along the lines of this: $('#myForm').ajaxForm({ beforeSubmit: myValidateFn }); function myValidateFn(arr, $form, opts) { // perform validation here and return false // to prevent the form from being submitted }; Mike On Nov 4, 2007 9:03 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Mike thanks again, > > I tried the code you just posted but the only thing that happens is, > it goes right to process.php. I'm trying to do this without a page > refresh then show the animation. Any ideas i have tried so many way to > get this to work and it seems theres alot of people who have had the > same issue but nothing set that works most are going another way which > is just going to another page but it there has to be a way > > > On Nov 3, 3:20 pm, "Mike Alsup" <[EMAIL PROTECTED]> wrote: > > > > > $('#subscribeform').ajaxForm(function() { > > > > > $(this).validate(); > > > > > function runIt() { > > > > > $("#cover").fadeIn("fast"); > > > > > $("#sform").fadeOut(1); > > > > > } > > > > > runIt(); > > > > > }); > > > > I didn't realize you were using the validation plugin. You'll need to > > do something like this: > > > > $("#subscribeform").validate({ > > submitHandler: function(form) { > > $(form).ajaxSubmit(); > > } > > > > }); > > > > More examples can be found here: > > > > http://bassistance.de/jquery-plugins/jquery-plugin-validation/ > > > > Mike > >
[jQuery] Re: validate on ajaxform
Mike thanks again, I tried the code you just posted but the only thing that happens is, it goes right to process.php. I'm trying to do this without a page refresh then show the animation. Any ideas i have tried so many way to get this to work and it seems theres alot of people who have had the same issue but nothing set that works most are going another way which is just going to another page but it there has to be a way On Nov 3, 3:20 pm, "Mike Alsup" <[EMAIL PROTECTED]> wrote: > > > > $('#subscribeform').ajaxForm(function() { > > > > $(this).validate(); > > > > function runIt() { > > > > $("#cover").fadeIn("fast"); > > > > $("#sform").fadeOut(1); > > > > } > > > > runIt(); > > > > }); > > I didn't realize you were using the validation plugin. You'll need to > do something like this: > > $("#subscribeform").validate({ > submitHandler: function(form) { > $(form).ajaxSubmit(); > } > > }); > > More examples can be found here: > > http://bassistance.de/jquery-plugins/jquery-plugin-validation/ > > Mike
[jQuery] Re: validate on ajaxform
> > > $('#subscribeform').ajaxForm(function() { > > > $(this).validate(); > > > function runIt() { > > > $("#cover").fadeIn("fast"); > > > $("#sform").fadeOut(1); > > > } > > > runIt(); > > > }); I didn't realize you were using the validation plugin. You'll need to do something like this: $("#subscribeform").validate({ submitHandler: function(form) { $(form).ajaxSubmit(); } }); More examples can be found here: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ Mike
[jQuery] Re: validate on ajaxform
also so you can see a visual of what i have and the function of it go here www.linkjet.com click on the subscribe button to expand with jquery if you hit submit it just goes right thru, no validation :( On Nov 3, 6:42 am, "Mike Alsup" <[EMAIL PROTECTED]> wrote: > > $('#subscribeform').ajaxForm(function() { > > $(this).validate(); > > function runIt() { > > $("#cover").fadeIn("fast"); > > $("#sform").fadeOut(1); > > } > > runIt(); > > }); > > There are several bare-bones validation examples here: > > http://www.malsup.com/jquery/form/#code-samples
[jQuery] Re: validate on ajaxform
Thanks Mike, i tried many if the examples there but couldn't get any of them to work within my ajaxform when i put { beforeSubmit: validate } in my ajaxform it breaks and nothing will run. Any suggestions on the code? On Nov 3, 6:42 am, "Mike Alsup" <[EMAIL PROTECTED]> wrote: > > $('#subscribeform').ajaxForm(function() { > > $(this).validate(); > > function runIt() { > > $("#cover").fadeIn("fast"); > > $("#sform").fadeOut(1); > > } > > runIt(); > > }); > > There are several bare-bones validation examples here: > > http://www.malsup.com/jquery/form/#code-samples
[jQuery] Re: validate on ajaxform
> $('#subscribeform').ajaxForm(function() { > $(this).validate(); > function runIt() { > $("#cover").fadeIn("fast"); > $("#sform").fadeOut(1); > } > runIt(); > }); There are several bare-bones validation examples here: http://www.malsup.com/jquery/form/#code-samples