php listing to the input.php file in PHP Ajax project in
JDeveloper. Next, run the input.php script in the Apache web server.
Right-click on input.php and select Run as shown in Fig. 8.7.
176 8 Ajax with PHP-Xajax
Fig. 8.7 Running Xajax Application
The input form gets displayed. Start adding a value for the Catalog Id
field. An XMLHttpRequest request is sent to the server with each
addition to the text field. The input page gets updated with response from
the server that contains instructions about the validity of the Catalog Id. A
message gets displayed to verify if the Catalog Id field value is valid as
shown in Fig. 8.8.
8.7 Processing the Ajax Response 177
Fig. 8.8 Validating Catalog Id
If a value is specified that is already defined in the Catalog table, a
message ???Catalog Id is not Valid??? gets displayed. For example, add
catalog1 to Catalog Id field. As catalog1 is already defined the ???not
valid??? message gets displayed as shown in Fig. 8.9.
Fig. 8.9 Non Valid Catalog Id
178 8 Ajax with PHP-Xajax
A new catalog entry may be created by specifying a Catalog Id field
that is valid and adding values to the other form fields. Click on the Create
Catalog button to create a catalog entry as shown in Fig. 8.10.
Fig. 8.10 Creating a Catalog Entry
If Catalog Id field previously used to create a catalog entry,
catalog4 in the example, is specified a message, ???Catalog Id is not
Valid???, gets displayed as shown in Fig.
Pages:
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163