SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 44 | Next

Deepak Vohra

"Ajax in Oracle JDeveloper"

getElementById(???submitForm???).disabled =
false;
}
If the element value is false, set the HTML of the div
element in Catalog ID field row to ???Catalog Id is not Valid???. Disable the
submit button, and set the values of the other input fields.
36 2 Developing an Ajax Web Application
if(valid==???false???){
var
validationMessage=document.getElementById(???validation
Message???);
validationMessage.innerHTML = ???Catalog Id is not
Valid???;
document.getElementById(???submitForm???).disabled =
true;
}
The input.js JavaScript file is listed below.
function validateCatalogId(){
var xmlHttpRequest=init();
function init(){
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
} else if (window.ActiveXObject) {
return new
ActiveXObject(???Microsoft.XMLHTTP???);
}
}
var
catalogId=document.getElementById(???catalogId???);
xmlHttpRequest.open(???GET???,
???validateForm?catalogId=???+
encodeURIComponent(catalogId.value), true);
xmlHttpRequest.onreadystatechange=processRequest;
xmlHttpRequest.send(null);
function processRequest(){
if(xmlHttpRequest.readyState==4){
if(xmlHttpRequest.status==200){
processResponse();
}
}
}
function processResponse(){
var xmlMessage=xmlHttpRequest.responseXML;
var
valid=xmlMessage.getElementsByTagName(???valid???)[0].
firstChild.nodeValue;
if(valid==???true???){
var
validationMessage=document.getElementById(???validatio
nMessage???);
validationMessage.


Pages:
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56