[jQuery] validate with form plugin

2008-05-11 Thread András Csányi
Hi all!

I'm new in jquery and i have a queston. Somebody knows usable example
like this to using form plugin with validate
plugin(http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-demo.html)?

I tried 4 hours writing a working code, but i have failed (and i'm
tired and nervos). I'm better in php and sql. Javascript isn't my
favorite language.

Thanks for the help and patience!

András

-- 
- -
-- Csanyi Andras -- http://sayusi.hu -- Sayusi Ando
-- Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] validate plugin + form plugin + thickbox

2007-05-12 Thread [EMAIL PROTECTED]

Hi Everyone,
I had an earlier problem that I asked about a couple days ago, turns
out it was just formatting bugs, but now I have a couple more.

Here's the problem:
I'm trying to use the form plugin, the validate plugin, and thickbox
together. The thickbox window has the form in it, which is loaded from
a hidden inline div in the page. The form is ajax submitted after
being validated by the validate plugin.
I have two issues I'm trying to deal with.

1. IE7/6 will run the validate script once correctly, but then stops
working, and attempting to submit the form again loads the page it's
targeting.  Firefox of course, runs fine.

2. I'd like to have the error messages returned from the validate
plugin to appear after the form fields that cause the errors, but they
are loading in the source div, not in the thickbox iframe.  Not sure
how to make that work.

Here's the code I'm using (also, I'm using $.getScript to load this
whenever thickbox loads a frame, to get it loaded inside the thickbox
frame, but if there's a better way to do that, let me know. I'm kind
of new to javascript.)

$(document).ready(function(){



 $('#TB_ajaxContent
#tbAjaxForm').validate({
 errorLabelContainer: $(#TB_ajaxContent #errorBox),
  wrapper:
p,
rules: {
email: {email:
true, required: true},
friendMail:
{email: true}
},
submitHandler: function(form) {
$(form).ajaxSubmit({
success: function() {
  self.parent.tb_show('Email My Visit','#TB_inline?
height=180width=407inlineId=tbSuccess','');
   },
error: function()
{
self.parent.tb_show('Email My
Visit','#TB_inline?height=180width=407inlineId=tbFailure','');
   }
});
}
});
});

Unfortunately, I can't post a link because it's a locked down dev
site, but if anyone has any insight, or would like any more
information, please let me know.

Thanks in advance for any help - I've been working on this for a
several days, and it's making me crazy.

-Chaim Eisenberg