...

View Full Version : Suddenly an error - object required



ScottInTexas
06-25-2004, 03:51 PM
This code has been running for at least a couple of years and suddenly it is throwing an "Object Required" error. The error only occurs when the mouse moves quickly over an element on the web page. The elements are drop downs. The javascript function is called via document.onmouseover = rollon

Here is the javascript.



function rollon() {
var myEvent;
myEvent = window.event.srcElement;

if (myEvent.className == 'menuitem') {


The if statement is the line throwing the error.

This is the area on the web page that is generating the call that throws the error.



<form method="POST" action="submitrequest_save.asp" onsubmit="return FormValidator(this)" name="RequestForm">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr><td>Submit Travel Approval Request</td></tr>
<tr>
<td width="30%" height="22">Budget Charged</td>
<td colspan="7" width="342" height="22">
<select size="1" id="BudgetCharged" tabindex="6">
<option selected>Choose One</option>
<option>LHC Tech Center</option>
<option>Project</option>
<option>Other Dow Biz</option>
<option>Outside Dow</option>
</select>
<input type="hidden" id="budget" name="budget" value></td>
</tr>
<tr>
<td width="30%" height="22">Amount (USD)</td>
<td colspan="7" width="342" height="22">
<input type="text" id="6" name="OrigRequestValue" size="20" tabindex="7"></td>
</tr>
<tr>
<td width="30%" height="22">1st Reviewer</td>
<td colspan="7" width="342" height="22">
<%
vSQL="Select * from [trefPeople];"
Set oRSdrp = Server.CreateObject("ADODB.Recordset")
' open recordset
oRSdrp.Open vSQL, oConn, adOpenDynamic
oRSdrp.Find "UserID='" & session("uid") & "'"
Apprvr=oRSdrp("FirstApprover")
oRSdrp.Close
vSQL="Select UserID, Name from [trefPeople] WHERE Lname='" & apprvr & "'"
oRSdrp.Open vSQL, oConn, adOpenDynamic
%><input type="hidden" id="7" name="ApproveID" tabindex="8" value="<% =oRSdrp("UserID") %>">
<input type="text" name="appName" value="<% =oRSdrp("Name") %>" disabled="false">
<%
oRSdrp.Close
Set oRSdrp=Nothing
%>
</td>
</tr>
</table>

Some of the table was left out for brevity, but I wanted to make sure I included enough so you could see clearly what was going on.

Thanks for your help

neofibril
06-26-2004, 04:34 PM
Why are you assigning onmouseover to the entire document for this?

ScottInTexas
06-29-2004, 03:29 PM
This file was written by someone else. Apparently it is supposed to check every element on a page and make sure it is not a menuItem. This one file is for all web pages within the global web site. The menu is is also a global menu. In any case I have to work with it. I would've thought there was a better way to do it.

neofibril
06-29-2004, 04:34 PM
Some of the table was left out for brevity, but I wanted to make sure I included enough so you could see clearly what was going on.
Tell me, ScottInTexas:
From the example you've provided, can one readily copy and paste the code to observe said error?

You might be better assisted by removing irrelevant ASP data, providing an enclosed script, and testing the example so that one can see what's happening, without having to guess at the actual configuration.

Willy Duitt
06-29-2004, 05:07 PM
Tell me, ScottInTexas:
From the example you've provided, can one readily copy and paste the code to observe said error?

You might be better assisted by removing irrelevant ASP data, providing an enclosed script, and testing the example so that one can see what's happening, without having to guess at the actual configuration.

Or perhaps provide the rendered page codes.
(view source after the page is parsed and post that)

ScottInTexas
06-30-2004, 01:38 PM
Thanks for the replies. The problem was that I had a text box disabled. It appears that whenever the mouse rolled over that particular text box fast, the error was thrown by the if statement in the javascript. I unlocked the text box and can no longer generate the error.

I appologize for making this difficult by not including more of the code. One of the problems here is that nearly the entire intranet is filled with secret stuff and it is difficult to post without compromising security. If I cut and paste then change things so the security is maintained, I wont have an accurate picture of the truth so the post would be moot.

I appreciate your help anyway. Hope I can return the favor.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum