Greetings,

I have been struggling with this for some time. The page uses:

    jquery 1.2.6
    jquery.form.js
    jquery.validate.js

I have a form which is generated like so:

A. a user clicks on an image
B. div containing image slides up (is hidden)
C. a form (prepopulated with data by php from a mysql db) is loaded by
a ajax (.load) into the area of the page

The problem is that I cannot get the validate plugin to validate the
dynamically loaded form (C). Obviously this form did not exist when
the page was first loaded so I'm not even sure how/when/where to bind
it to .validate. The rules and addmethods are fairly complex but, when
I save the form as a static page, it validates fine. It just doesn't
work when loaded into the page dynamically. The code is too long to
post.

I have tried the following (example) within the click event handler
(A):

$('#content').load("myscript.php",{ dataA: varA, dataB: varB}, function
() {
    $("#myform").validate();
    // I tried this too: $("#myform").validate().form();
});

I have googled a lot looking for an example like this, including the
docs, or for a solution to my problem (error) but I am stuck on this
one. I'm sure it's my lack of knowledge but any help appreciated.

Thanks in advance

Reply via email to