[jQuery] ajaxForm() submits to form action=foo.php

2006-10-11 Thread Michael Retrum
Hey guys,
I'm having some issues with a commenting module built using jQuery 
ajaxForm().  The commenting module simply takes the data from a textarea 
in a form and submits it to a Php processing script for behind the 
scenes processing.  Most of the time, (95%) the system performs as 
intended but every once in awhile a user reports issues with being sent 
to a blank page upon pressing the submit button to the form.  It appears 
that people on slower connections are sometimes being sent to the Php 
processing script defined in the form action=foo.php attribute which 
in turn reveals the blank foo.php page with no action performed.  
Essentially, the form is acting normally and being physically sent to 
foo.php instead of performing the intended behind the scenes AJAX behavior.

Any ideas on why this is happening and how to correct it, I'm pretty 
stumped, Thanks!

-Mike

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] ajaxForm() submits to form action=foo.php

2006-10-11 Thread Blair McKenzie
A good approach to use with this kind of situation (where the user connection/browser/etc can't be assumed) is to implement all functionality so that it can work without JS, and then hijack the form on page load and convert it to AJAX. 
Another thread on this list brought up a very elegant way to handle this kind of situation. jQuery sets a special variable in the request header of its AJAX requests. The server script checks for that variable and returns different output based on that.
BlairOn 10/12/06, Michael Retrum [EMAIL PROTECTED] wrote:
Hey guys,I'm having some issues with a commenting module built using jQueryajaxForm().The commenting module simply takes the data from a textareain a form and submits it to a Php processing script for behind the
scenes processing.Most of the time, (95%) the system performs asintended but every once in awhile a user reports issues with being sentto a blank page upon pressing the submit button to the form.It appears
that people on slower connections are sometimes being sent to the Phpprocessing script defined in the form action="" attribute whichin turn reveals the blank foo.php page with no action performed.
Essentially, the form is acting normally and being physically sent tofoo.php instead of performing the intended behind the scenes AJAX behavior.Any ideas on why this is happening and how to correct it, I'm pretty
stumped, Thanks!-Mike___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/