Form submission without redirect?
Moderator: General Moderators
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Form submission without redirect?
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?
What do you mean "without a redirect"? Do you mean without a refresh? If so, than yes, AJAX is the way to go. If you're just looking to post to the same page you're on, just do this
(let's say the page you are posting from is called "index.php"...
Or this
(let's say the page you are posting from is called "index.php"...
Code: Select all
<form method="post" action="index.php">Code: Select all
<form method="post" action="#">Re: Form submission without redirect?
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?
basically it goes to...
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.- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
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.
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.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
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.
To be to the point, you need AJAX for what you're trying to do. That's it.
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact: