Mike:

You have to reattach events to documents loaded dynamically, so you can do
something like:

$.ajax({
 ...,
 success: function(html) {
   $(body).append(html).find("form").submit(function(){
     /* Validate function here */
   })
 },
 ...
});

Hope that helps!
- jake

On 5/16/07, Michael Sharman <[EMAIL PROTECTED]> wrote:


Hi Jake,

There is a version here: http://www.21goals.com/demo/

Basically when you submit the 'Add Goal' page (when it's empty) you
get jquery validation.

If I then click the 'login' link from the header the login page is
loaded via Ajax. It is this page which I want to validate exactly like
the first form.

Michael

On May 16, 11:26 pm, "Jake McGraw" <[EMAIL PROTECTED]> wrote:
> Mike:
>
> Do you have a live example?
>
> - jake
>
> On 5/16/07, Michael Sharman <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi guys,
>
> > I have a page which contains javascript validation for an existing
> > form. There is also a link where another form can be loaded onto the
> > page via ajax, this step is working fine.
>
> > My problem is that the validation/submission code in the page header
> > isn't picking up my *new* form (from the ajax request) as the new form
> > fields aren't in the DOM.
>
> > Is this something anyone has come across before and has a solution
> > for?
>
> > Thanks


Reply via email to