HTML and CSS Reference
Figure 18.15 XML file has been read and processed by Ajax and the DOM.
There are several reasons why you might choose to use Ajax for forms in your Web page.
1. Faster validation.
2. Auto-completing the form fields.
3. Spell checking in real time.
4. Updating content (weather updates, auctions, stock tickers).
5. Dynamically updating a list based on user input.
When creating non-Ajax HTML forms, the <form> tag takes an ACTION attribute and
a METHOD attribute. The ACTION attribute is used to specify the URL of a server-side
program that will deal with form input after the submit button is clicked, and the
METHOD attribute determines how the input will be sent, either with the HTTP GET
or POST methods. In the traditional HTML form, the form will have a submit button
that, when clicked, causes the browser to bundle up the input data into a URI encoded
query string consisting of name/value pairs. This encoded data will be sent to the server-
side program named in the ACTION attribute of the form. If the method is GET, the
query string will be appended to the URL prepended with a question mark, visible in the
location box of the browser. If the method is POST, the encoded data will be sent as a