Thursday, May 20, 2010

Workshop 7

AJAX Tool Tip and PHP Form Reading

This workshop demonstrates how to use PHP forms. Forms are a special component which allows site visitors to supply information on another web page or server.
AJAX: Asynchronous JavaScript and XML (AJAX) have been used to display tool tip for text box. Whenever user places a cursor in any of the three text boxes, program will display a corresponding tool tip message. Web server might be some where in United States, however using AJAX this program is able to retrieve data from the server asynchronously in the background without refreshing the web page. Data is retrieved using the XMLHttpRequest object. This object has been used to send HTTP or HTTPS requests directly to a web server and load the server response data directly back into the script.
Functionality: This program asks user to input his name, birth year and favorite color. JavaScript validation has been used to validate the input values. Finally, this program calculates user's age and display the text - name and age in user's favorite color.

Test Code

No comments:

Post a Comment