473,769 Members | 7,315 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting error while entry in userid field/responseText not returning value

vikas251074
198 New Member
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'.

Expand|Select|Wrap|Line Numbers
  1. <form name="myform" action="main.asp" method="post">
  2. <div id="content"> 
  3.   <h2 id="pageName">Main Page</h2> 
  4.   <div class="feature"> 
  5.     <h1>Surfing the intranet </h1> 
  6.     <p>
  7.     This is a comprehensive information website on Indian Oil Corporation Limited and specially 
  8.     dedicated to IOCL.
  9.     </p>
  10.   </div> 
  11.   <div class="login" style="position:relative; left:50px"> 
  12.     <table border="1" cellpadding="0" cellspacing="0">
  13.     <tr>
  14.       <td bgcolor="#99FF99"><h3>Employee Login</h3></td>
  15.     </tr>
  16.     <tr>
  17.       <td>
  18.         <table bgcolor="#CCFFCC">
  19.           <tr>
  20.             <td align="right">Login :</td>
  21.             <td><input type="text" name="userid" id="userid" style="width:100px " onblur="userid(this.value);"/></td>
  22.           </tr>
  23.           <tr>
  24.             <td align="right">Password :</td>
  25.             <td><input type="password" name="passwd" style="width:100px "/></td>
  26.           </tr>
  27.         </table>
  28.       </td>
  29.     </tr>
  30.     <tr>
  31.       <td>
  32.         <table bgcolor="#CCFFCC">
  33.           <tr>
  34.             <td><a href="#">Forgot Password?</a></td>
  35.             <td><input type="button" style="width:65px " value="Go" onClick="login();"/></td>
  36.           </tr>
  37.         </table>
  38.       </td>
  39.     </tr>
  40.     </table>
  41.   </div> 
  42. </form>

The description of userid(this.val ue) is as follows -
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. var xmlHttp
  3.  
  4. function userid1(str){
  5.   xmlHttp=GetXmlHttpObject();
  6.   if (xmlHttp==null) {
  7.     alert ("Your browser does not support AJAX!");
  8.     return;
  9.   } 
  10.   var url="checkuser.asp?q="+str+"&sid="+Math.random();
  11.   xmlHttp.onreadystatechange=stateChanged;
  12.   xmlHttp.open("GET",url,true);
  13.   xmlHttp.send(null);
  14. }
  15.  
  16. function stateChanged() { 
  17.   if (xmlHttp.readyState==4) {
  18.     document.getElementById("login").innerHTML=xmlHttp.responseText;}
  19. }
  20.  
  21. function GetXmlHttpObject(){
  22.   var xmlHttp=null;
  23.   try { xmlHttp=new XMLHttpRequest();  }   // Firefox, Opera 8.0+, Safari
  24.   catch (e){ 
  25.     try {xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}   // Internet Explorer
  26.     catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
  27.   }
  28.   return xmlHttp;
  29. }
  30.  
  31. </script>
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
Jun 20 '08 #1
21 3898
gits
5,390 Recognized Expert Moderator Expert
try the following:

Expand|Select|Wrap|Line Numbers
  1. document.getElementById("login").value = xmlHttp.responseText;
instead of using innerHTML ...

kind regards
Jun 20 '08 #2
vikas251074
198 New Member
I have tried this, but get no solution.

I think login is not an <div Id >. It is a <div class=login>

So how this problem will be solved.

Thanks and regards,
Vikas
Jun 20 '08 #3
gits
5,390 Recognized Expert Moderator Expert
aaarg ... sorry i just had a quicklook and overlooked that ... the value will not work with divs ... of course.

just give your div an id="login" ... is there any reason why you didn't do that?

kind regards
Jun 20 '08 #4
vikas251074
198 New Member
Yes sir,
I have created main div with an <div id="content">
And all the div created with in this div is defined in
<div class="feature" >
<div class="login">

I have done this way. Is it wrong?

Thanks and regads,
Vikas
Jun 20 '08 #5
acoder
16,027 Recognized Expert Moderator MVP
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'.
Well, it's not surprising if you've called it userid1.
Jun 20 '08 #6
vikas251074
198 New Member
Yes I have done this also, but not getting solution. The error message is same.

Thanks and regards,
Vikas
Jun 20 '08 #7
acoder
16,027 Recognized Expert Moderator MVP
Have you added the id to the div as suggested earlier?
Jun 20 '08 #8
vikas251074
198 New Member
Yes,
I have done that way also

<div id="login">
and also
<div id="login1">

But with no hope!!!!
Jun 21 '08 #9
acoder
16,027 Recognized Expert Moderator MVP
Post the latest version of your code.
Jun 21 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
893
by: Dinçer | last post by:
Hi, I am trying to get user data (email data actually) from Active Directory. What I exactly want to do is, getting the email address according to username from the domain. For example, when I enter my username DINCERM, it should give me dincerm@domain.com as result. When I do this: ===
11
12484
by: David Messner | last post by:
Ok I know this is simple but the statement eludes me... I have a date field where I want the default value on the data entry form's date field to be the last date entered. I figure I can do this with a query but don't know what the criteria needs to be. Any help would be appreciated, Thanks
2
11948
by: Alex Wisnoski | last post by:
I have an A97 application that I am modifying. I have created an unbound form, "zfrmTestEnterPlacements", with a subform, "zsfrmSelectPlacement". The intent is to use a combo box on the primary form to look up 'exhibitor-entry' data and populate a few fields on this form. The EntryID(number-long data type) will be passed to a textbox on the subform. The user will then use a combo box on the subform to look up the appropriate ...
11
4833
by: suzy | last post by:
i am trying to write aspx login system and the login process requires a validity check of username and password. i have been told that raising exception is costly, but i want a custom error message to be displayed depending on what error occurred (let's say: invalid username, invalid password, password must contain 5 or more characters, etc). at the moment, my login method is returning true/false depending on whether the login was...
7
5024
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying. I created the websetup and built the MSI, have the bundled version. Copied to webserver and ran Websetup.msi. Said I had to remove old version, which I did, then reran WebSetup.msi and keeps giving me this error. "The installer was interrupted...
1
5350
by: C.Joseph Drayton | last post by:
Hi All, I am not sure if this is a JavaScript or PHP error. Basically what is happening, is that I have an HTML page with the following JavaScript. As you can see makeRequest() calls a PHP script which is included below. When the code is executed, I get the following error in FireFox's JavaScript console;
6
1972
by: MLH | last post by:
I have a query (SQL below) that operates on values entered by users into an unbound form to append a record to tblAdmin. I do not under- stand the basis for the error. There are some 17 or so data entry fields on the form housing perhaps 600-700 characters between the lot of them. Why might Access 97 need to err on such a simple operation? SQL: INSERT INTO tblAdmin (TowCompany, TowCoAddr, TowCoCity, TowCoState, TowCoZip, TowCoCounty,...
2
6658
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double) Location: class Week5MortgageGUI Week5MortgageLogic allint = logic.allInterest(amount, term, rate); Week5MortgageGUI.java:152:cannot find symbol symbol: method allInterest(double,double,double) Location: class Week5MortgageGUI
2
5593
DonRayner
by: DonRayner | last post by:
This one has me stumped. I'm getting a "Type Mismatch" error on one of my forms when it's being opened. It's hapening before the forms "On Open" event, I stuck a msgbox in there to check and I'm getting the error before it opens. The line of code that calls the form from another form is. DoCmd.OpenForm "NonConformanceAdd",,,,acFormAdd,acDialog I get the error, click ok, then the form opens and works exactly how it's supposed to. I even...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10219
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9998
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3567
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.