phpfunk.com


Ajax Examples

These examples use the prototype library.
View the HTML source to see my javascript functions.
Refer to the prototype API for examples and explanations of Ajax, etc.

Example One

Here we submit a form in an ajax way. The onsubmit is used to send the request and get the response and update the div. The return false in onsubmit is so the form doesn't actually submit the regular way.

This div will update when you submit the form.
Your Name:

View php handler source

Example Two

In this case we will do an ajax request w/ onchange event.

Make a selection to change this

View php handler source

Example Three

This example demos adding and removing rows from a table. The server handler page is responsible to send back a properly formatted HTML row.

Time 


View handler source