|
Posted by www.douglassdavis.com on March 13, 2008, 7:34 am
Please log in for more thread options
Say I have a div with a form in it. What I would like to do is POST
the form to a php script, then show the results that the php page
outputs in that same div, without refreshing the entire page.
This seems like a client side issue, so, I would think it could be
done in Javascript, however, I'm not sure how. I downloaded the
Javascript Prototype library, so if there is a way to do it with that
library, then that would be good.
Does any one know how to do this or have suggestions?
Thanks.
|
|
Posted by GArlington on March 13, 2008, 7:39 am
Please log in for more thread options
On Mar 13, 11:34 am, "www.douglassdavis.com"
> Say I have a div with a form in it. What I would like to do is POST
> the form to a php script, then show the results that the php page
> outputs in that same div, without refreshing the entire page.
>
> This seems like a client side issue, so, I would think it could be
> done in Javascript, however, I'm not sure how. I downloaded the
> Javascript Prototype library, so if there is a way to do it with that
> library, then that would be good.
>
> Does any one know how to do this or have suggestions?
>
> Thanks.
You should look for AJAX... and how to use that...
|
|
Posted by Rik Wasmus on March 13, 2008, 7:39 am
Please log in for more thread options On Thu, 13 Mar 2008 12:34:58 +0100, www.douglassdavis.com
> Say I have a div with a form in it. What I would like to do is POST
> the form to a php script, then show the results that the php page
> outputs in that same div, without refreshing the entire page.
>
> This seems like a client side issue, so, I would think it could be
> done in Javascript, however, I'm not sure how. I downloaded the
> Javascript Prototype library, so if there is a way to do it with that
> library, then that would be good.
>
> Does any one know how to do this or have suggestions?
I'd say only relevan to comp.lang.javascript. The only thing PHP related
is you'll have a script delivering an HTML fragment rather then a full
page. It would work the same way if you used .NET, Perl, Python, or
whatever you fancy.
f'upped to c.l.javascript only.
--
Rik Wasmus
|
|
Posted by Tanin on March 13, 2008, 8:34 am
Please log in for more thread options your form action should submit the information manually to your server
script and then stop because you obviously don't want the form to
submit again using its default behavior. You can use the
XMLHttpRequest object to send the information to the script and wait
for the response using the object's onreadystatechange event.
Here's a nice tutorial that should help you along the way:
http://www.technetra.com/writings/archive/2005/04/27/snappier-web-applications-with-xmlhttprequest
On Mar 13, 12:34 pm, "www.douglassdavis.com"
> Say I have a div with a form in it. What I would like to do is POST
> the form to a php script, then show the results that the php page
> outputs in that same div, without refreshing the entire page.
>
> This seems like a client side issue, so, I would think it could be
> done in Javascript, however, I'm not sure how. I downloaded the
> Javascript Prototype library, so if there is a way to do it with that
> library, then that would be good.
>
> Does any one know how to do this or have suggestions?
>
> Thanks.
|
|
Posted by Mason Barge on March 13, 2008, 12:07 pm
Please log in for more thread options
>
>
> Say I have a div with a form in it. What I would like to do is POST
> the form to a php script, then show the results that the php page
> outputs in that same div, without refreshing the entire page.
>
> This seems like a client side issue, so, I would think it could be
> done in Javascript, however, I'm not sure how. I downloaded the
> Javascript Prototype library, so if there is a way to do it with that
> library, then that would be good.
>
> Does any one know how to do this or have suggestions?
>
> Thanks.
You're confusing types of scripts. You cannot transmit a form result to PHP
without a page reload, because PHP is a server side script.
You are looking in the right direction with javascript. It's just a
confusion in terminology. This has nothing to do with PHP (except perhaps
coincidentally if the form overlaps with a javascript form).
|
| Similar Threads | Posted | | posting 20050827 | August 27, 2005, 7:12 am |
| Posting a form into new window | September 25, 2004, 4:13 pm |
| ciwah FAQ posting policy? | April 18, 2007, 4:51 pm |
| Form Not Posting in Frame in IE7 | April 23, 2007, 2:21 pm |
| posting an online form | August 23, 2007, 11:53 am |
| Usenet Abuse: Someone at IP address 246.244.57.201 is impersonating me and posting nonsense | September 6, 2007, 4:04 am |
| Inconsistent results across browsers | June 1, 2007, 3:29 pm |
| Layout problem - different results in browsers | August 7, 2007, 12:07 pm |
| Empty SGML parser results in w3 validator | November 20, 2004, 1:42 am |
| New webhosting service. Same search engine results? | December 20, 2004, 10:32 pm |
|