2 On Ajax-enabled browers, when the user clicks
Add, the page-specifi c JavaScript will read in all the
form data and submit it to a new PHP script. On pages
63-66, we??™ll begin the JavaScript fi le that starts this
process.
3 The PHP script, written on pages 67-74, will validate
all the data and report on the results. Its response
will be returned as XML.
4 The JavaScript will take the XML returned by the
PHP script and use it to update the HTML page. We??™ll
complete this fi le on pages 75-79.
5 Naturally, we??™ll test what we??™ve built to make sure
it all works.
6 At the end of this chapter, in the extra bits section,
you??™ll fi nd more information, tips, and recommendations
regarding all of these steps.
60 adding records via Ajax
HTML page
Form data
XML data
adding records via Ajax 61
add the Ajax elements
1 Include the generic Ajax JavaScript fi le by adding the
right code to the HTML head. (See extra bits on page 82.)
2 Include the page-specifi c Ajax JavaScript fi le by adding
that code to the HTML head. We??™ll start making this script
next.
3 Add a DIV to the HTML page to report upon the results.
Pages:
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70