View Single Post
Old 05-18-2006, 07:20 PM   #1 (permalink)
Redline
PHP Student
 
Join Date: Oct 2004
Location: Forest Grove, OR
Posts: 150
Redline is on a distinguished road
Send a message via AIM to Redline Send a message via MSN to Redline
Javascript Submit Form Options?

Okay, I'm putting together a user registration form using PHP, javascript and ajax.

The username and image-text verification string are checked by calling a php script with ajax. The problem is it takes about 1-2 seconds for the response and I can't seem to make the script wait for the response before moving on. This ultimately causes the form validation function to return a false result.

I was able to setup a while() loop to loop continually until a flag is set at the end of the processResponse function of the AJAX request, but this loop delays the ajax response even more and triggers a javascript warning in firefox.

The best way I can think of solving this is to submit the form from within javascript when a response is received through AJAX, and I've tried it. Apparently "document.myform.submit()" is no-longer a valid function? There must be another way to submit forms via javascript besides the "onsubmit" handler?
__________________
Current Project
Redline is offline   Reply With Quote