Before an XMLHttpRequest is initiated, specify the xajax object to handle requests with the processRequests() function. 8.6 Processing an Ajax Request 169 $xajax->processRequests(); Also specify in the tags of the input form that Xajax should generate any required JavaScript after an XML response has been sent back from the server. printJavascript(???./xajax??™); ?> An XMLHttpRequest is initiated by a client application. In the example application, an XMLHttpRequest is initiated by the onkeyup event handler in input field catalogId.
The Catalog Id input field invokes the wrapper function xajax_validateCatalogId with an array of form field values as a parameter. The wrapper functions send an XMLHttpRequest to the server. The xajax object receives the XMLHttpRequest and invokes the corresponding PHP function validateCatalogId($formValues). 8.6 Processing an Ajax Request Xajax provides the xajaxResponse class to send a response to the client application. In the validateCatalogId function, create a xajaxResponse object. $objResponse = new xajaxResponse(); The validateCatalogId function validates a Catalog Id value added in the input form.