problems with javascript, need Help

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
DavidWarden
Forum Newbie
Posts: 2
Joined: Sat May 15, 2010 11:44 am

problems with javascript, need Help

Post by DavidWarden »

Hi there

I have a small question:

I have a mainpage and load "content" via javascript in a DIV.
this is working perfect.

but now this "content" has a form and I want use http://livevalidation.com/ to validate this form.
Now here nothing is working :cry:

I can use the livevalidation on any form without problems but it's not working on the external loaded "content".

WHY???

thank you!
cpetercarter
Forum Contributor
Posts: 474
Joined: Sat Jul 25, 2009 2:00 am

Re: problems with javascript, need Help

Post by cpetercarter »

It may be to do with the order in which things happen.

Your page loads. It contains an empty div where later the browser will place content. The form validation script loads. It scans the page and finds no form. Then the script runs which loads the content. It loads the form into the page. But the validation script does not know that this has happened. So you do not get automatic live validation.

You may be able to solve the problem by ensuring that the content loads before the form validation script is called.
Post Reply