Computing.Net > Forums > Web Development > can we return to server while ses..

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

can we return to server while ses..

Reply to Message Icon

Name: etrix
Date: January 4, 2008 at 03:42:13 Pacific
OS: win xp
CPU/Ram: P4 / 256 mb
Comment:

Hi,
can anybody advice me at what extent we can replace javascript with php?. Can we pick value from html form to php without form submission?.
if we can than how?

viveka



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: January 4, 2008 at 14:30:17 Pacific
Reply:

In a sense, yes.

You can use AJAX (combination of JavaScript and server-side pages) to send/receive data from a web page and the server. So, you could use any JavaScript trigger to call a function that will "grab" a value from the form, submit it to a PHP page (transparent to the user) and return back the results to the JavaScript which can act upon it further.

One common use for this would be if you have dependant select lists. For example, if you want the user to select a region and then select an office in that region, you would want the "office" field to dynamically change when the region is selected. For a small list I would do this all in JS, but for large or complex lists you could use AJAX. When the user changes the region, JS is used to send the selected region to a PHP page which returns the list of offices. The JS then uses that list to repopulate the "offices" list.

There are many AJAX turorials available on the web.

Michael J


0
Reply to Message Icon

Related Posts

See More


Simple Nav menu bar RSS script



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: can we return to server while ses..

Can we run standalonejava on Sun6.0 www.computing.net/answers/webdevel/can-we-run-standalonejava-on-sun60/2474.html

remote server to server upload script www.computing.net/answers/webdevel/remote-server-to-server-upload-script/4175.html

Non stop reload of a page to server www.computing.net/answers/webdevel/non-stop-reload-of-a-page-to-server/4310.html