Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onmouseover Error

Status
Not open for further replies.

luckydexte

Programmer
Apr 26, 2001
84
US
Hello all,

I am sure this is very easy but I am stumped. I am getting the error "object doesn't support this property or method" when using the onmouseover event. The error is triggered as soon as my mouse goes over the href tag. The code is really simple but I am not sure why I am getting an error. Any help will be appreciated.

<a href='javascript:void(0);' onclick="addNewVendor();" onMouseOver="status='Add New Owner'; return true;" onMouseOut="status='';"> Add New</a>

Thanks.

 
I'm not sure that's the problem. I have no problem with that line of code in IE6.

That error is almost always because you are applying a method to a data type that doesn't support it. Most the time for me, it's applying a string method onto some data that isn't yet parsed into a string.



[monkey][snake] <.
 
I have worked on it some more and the line of code works fine for me in IE6. However, when I put that line of code inside of my form tag is when I have a problem.

Example:

<a href.....></a> // This works
<form>
---------------------------------------------

<form>
<a href.....></a> // This throws me the error
</form>

Any ideas? I just figured that out and have not researched it yet.

Thanks.
 
Can you post more of your code?

This is exactly what I have, and it works:

Code:
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]
<html>
<head>
</head>
<body>
<form>
<a href='javascript:void(0);' onclick="addNewVendor();" onMouseOver="status='Add New Owner'; return true;" onMouseOut="status='';"> Add New</a>
</form>
</body>
</html>

I tried it with and without a DOCTYPE and it worked fine both ways.

[monkey][snake] <.
 
Sure can. The code is below. It works if I remove the last <tr></tr> set of tags. But when I leave them in it does not work. I commented the code below so that you can see what lines can be removed to make it work. Thanks for your help.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="../theme/Master.css" rel="stylesheet" type="text/css">
<TITLE>Title</TITLE>
</HEAD>

<BODY>

<div id="error"></div>
<form name="GeneralPermit" method="post" action="/DPW/IndGeneralPermitSave.do">
<a href='javascript:void(0);' onclick="addNewVendor();" onMouseOver="status='Add New Owner'; return true;" onMouseOut="status='';"> Add New</a>
<table border="0" width="90%" align="center" class="tablefont" cellspacing="1" cellpadding="1">

<tr>
<td class="text" width="15%">Application No: </td>
<td width="85%"><input type="text" name="appNumber" maxlength="8" size="8" value=""></td>
</tr>
<tr>
<td class="text" width="15%">Permit Type: </td>
<td width="85%"><input type="text" name="permitType" maxlength="15" size="15" value="INDIVIDUAL" readonly="readonly"><a href='javascript:void(0);' onclick="addNewVendor();" onMouseOver="status='Add New Owner'; return true;" onMouseOut="status='';"> Add New</a></td>
</tr>
<tr>
<td class="text" width="15%">Emergency: </td>
<td width="85%">
<select name="emergency"><option value="N">N</option>
<option value="Y">Y</option></select>
</td>
</tr>
<!-- The code below between the tr tags is giving me problems -->
<tr>
<td class="text" width="15%">Status: </td>
<td width="85%">
<select name="status"><option value="OP">Opened</option>
<option value="CL">Closed</option>
<option value="DE">Denied</option>
<option value="WD">Withdrawn</option></select>
</td>
</tr>
<!-- End of problem -->
</TABLE>
</form>
</BODY>
</html>
 
Dan, that was the problem. I have a field in my form called status and I guess there was a naming conflict. When I use window.status it works fine.

Thanks for the help from both of you. I should have seen it but I guess that is what happens when you work with the same code for weeks at a time.

Cheers
 
It's the name you are using:

select name="status"


Change that name.

when you put status=, it's first looking for the select box.

[monkey][snake] <.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top