I am getting error while entry in userid field. When user enter his user id, an event is fired immediately and user id is verified using AJAX method. But I am getting error 'Object doesn't support this property or method'.
The description of userid(this.val ue) is as follows -
I think error is in line no. 21 where the function 'userid(this.va lue) is called and the error message is 'Object doesn't support this property or method'.
Thanks and regards,
Vikas
Code:
<form name="myform" action="main.asp" method="post"> <div id="content"> <h2 id="pageName">Main Page</h2> <div class="feature"> <h1>Surfing the intranet </h1> <p> This is a comprehensive information website on Indian Oil Corporation Limited and specially dedicated to IOCL. </p> </div> <div class="login" style="position:relative; left:50px"> <table border="1" cellpadding="0" cellspacing="0"> <tr> <td bgcolor="#99FF99"><h3>Employee Login</h3></td> </tr> <tr> <td> <table bgcolor="#CCFFCC"> <tr> <td align="right">Login :</td> <td><input type="text" name="userid" id="userid" style="width:100px " onblur="userid(this.value);"/></td> </tr> <tr> <td align="right">Password :</td> <td><input type="password" name="passwd" style="width:100px "/></td> </tr> </table> </td> </tr> <tr> <td> <table bgcolor="#CCFFCC"> <tr> <td><a href="#">Forgot Password?</a></td> <td><input type="button" style="width:65px " value="Go" onClick="login();"/></td> </tr> </table> </td> </tr> </table> </div> </form>
The description of userid(this.val ue) is as follows -
Code:
<script type="text/javascript"> var xmlHttp function userid1(str){ xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; } var url="checkuser.asp?q="+str+"&sid="+Math.random(); xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function stateChanged() { if (xmlHttp.readyState==4) { document.getElementById("login").innerHTML=xmlHttp.responseText;} } function GetXmlHttpObject(){ var xmlHttp=null; try { xmlHttp=new XMLHttpRequest(); } // Firefox, Opera 8.0+, Safari catch (e){ try {xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");} // Internet Explorer catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} } return xmlHttp; } </script>
Thanks and regards,
Vikas
Comment