Form submission without redirect?
Posted: Wed Nov 08, 2006 12:54 am
I would like to have users submit a form without a redirect. I can only guess AJAX would be the way to go and if so how would I go about it?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<form method="post" action="index.php">Code: Select all
<form method="post" action="#">it is all about the workflow of you application. if you think it over you will see in most cases no redirect is necessary.JAB Creations wrote:I would like to have users submit a form without a redirect. I can only guess AJAX would be the way to go and if so how would I go about it?
Code: Select all
//1.first process submitted data...if any.
//2.get data to fillin form (data will be updated...if processing submitted data ..or just default values...when you first see the form).
//3.display page.I'm pretty sure IE tries to download application/xhtml+xmlJAB Creations wrote:For clarification I want to exactly what a form does by default except to not redirect/reload.
I know the action attribute is required by various standards. I must keep this attribute and some valid value however I am curious if I can still submit the form and avoid AJAX altogether by stopping the redirect/reload?
If we can not then I suppose we should turn to AJAX then. I don't particularly care how it is executed except that it needs to be standards compliant and work with the application/xhtml+xml mime which most code does work with anyway. I only got as far as trying to use JavaScript to return false as the value of the action.