<html>
<head>
<title>Ajax demo</title>
</head>
<body >
<script type= "text/javascript" >
var req;
function validateUser() {
alert("validate catched")
if(window.XMLHttpRequest){
req=new XMLHttpRequest();
} else if (window.ActiveXObject) {
req=new ActiveXObject("Microsoft.XMLHTTP");
}
else{
alert("Your browser does not support XMLHTTP!");
}
alert("request catched")
var idField=document.getElementById("userid");
var url="localhost:1234/a/validate?id=" ;
url+=idField.value;
req.open("GET",url,true);
req.send(null);
}
</script>
<H1>Ajax Demo1</H1>
<form>
<input type="text" size="20" id="userid" name="id" onclick="validateUser();">
</form>
<div id="userIdMessage" size="20">
</div>
</body>
</html>
lkofman 0 Newbie Poster
Thirusha 20 Posting Whiz
lkofman 0 Newbie Poster
Thirusha 20 Posting Whiz
lkofman 0 Newbie Poster
Thirusha 20 Posting Whiz
lkofman 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.