The XMLHttpRequest is
initiated from the Catalog Id field, which is required to be validated. A
JavaScript function, validateCatalogId() is invoked with
onkeyup event. To the input.jsp add an input form with the
In the JavaScript file input.js create a JavaScript function
validateCatalogId() in which create a new XMLHttpRequest
object.
function validateCatalogId(){
var xmlHttpRequest=init();
function init(){
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
} else if (window.ActiveXObject) {
return new ActiveXObject(???Microsoft.XMLHTTP???);
}
}
}
Next, in the JavaScript file construct the URL to which the
XMLHttpRequest is to be sent. As the FormValidationServlet
is mapped to servlet URL validateForm, specify the URL as
validateForm with a catalogId parameter.
var catalogId=document.getElementById(???catalogId???);
xmlHttpRequest.
Pages:
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49