Click to See Complete Forum and Search --> : AJAX and javascript form validation


enifeder
July 14th, 2010, 01:10 AM
Hi there,

I currently have a problem with validating a form. The form is created by AJAX:

xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById("editUserContent").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getuser.php?q="+str,true);
xmlhttp.send();
}

getuser.php creates the form and echo's it back to the original page. On submitting of the form it uses javascript to check for errors or missing information. However the javascript is on the original page.

At the moment I can not get the javascript to work at all, I am guessing this is due to form being echo from getuser.php. The javascript works fine when not using ajax.

Everything else in the form works fine.

If anyone has any ideas please get back to me, thanks.

PeejAvery
July 19th, 2010, 01:44 PM
You have not included nearly enough code for us to help debug. All you've pasted is a small portion of the AJAX call.

ronty
April 20th, 2011, 08:13 PM
Hi
Please give us more detail

PeejAvery
April 20th, 2011, 09:04 PM
Welcome to the forums, ronty. :wave:

Please keep your posts relevant. This thread is already a year old.