The input form takes data to add a catalog entry to database table
Catalog. As a user begins to enter data in the input field Catalog Id, a
XMLHttpRequest is sent to the server to validate the Catalog Id value
added. If the Catalog Id is not already defined in the database, a message
???Catalog Id is Valid??? gets displayed. If the Catalog Id is already defined in
the database, a message ???Catalog Id is not Valid??? gets displayed, the
Create Catalog button gets disabled and field values for the Catalog Id get
added to the form. We have used business logic that if a catalog id is not
already defined the catalog id is valid. Additional business logic may be
added to match the catalog id with a PHP regular expression.
Extract xajax_0.2.4.zip file to the public_html directory of the PHP
Ajax project in JDeveloper. Rename the xajax_0.2.4 directory to xajax.
Create a PHP script in the PHP Ajax project. Select File>New. In the New
Gallery window select Web Tier>PHP in Categories. Select PHP File in
168 8 Ajax with PHP-Xajax
Items and click on OK. In the Create PHP File window specify a PHP
File Name, input.php, and click on OK.
The xajax PHP object performs the function of an intermediary
between the client application and the server. First, include the xajax
class library in input.php.
require('./xajax/xajax.inc.php');
Create a xajax object.
$xajax = new xajax();
The server side processing is performed by PHP functions.
Pages:
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154