View Full Version : Object doesn't support this property or method

02-16-2007, 05:45 PM
Hello all. I am having a small, and probably simple problem. The first set of code is the original in which an image was used for a Print function, although I changed it to a button with the second line of code. When testing, the first set of code works fine, but when I change it to the button style, I am getting the following error:

"Object doesn't support this property or method"

Here is the code:

<a href="javascript:print(document.MainForm)"><img src="../images/print.gif" border="0" alt="<%=msg(30)%>"><br>&nbsp;<%=msg(30)%>&nbsp;</a>

<input type="button" name="print" class="mnulabel" title="<%=msg(30)%>" value="<%=msg(30)%>" onClick="javascript:print(document.MainForm)">

By the way, here is the function being called:

<script language="javascript">
function print(frm)
var sql = "<%=Server.URLEncode(sSQL)%>"
var URL = "../Rpts/inventory/InvCount.asp?sql=" + sql;
var newWin = window.open(URL,'ReportWnd','menubar=yes,toolbar=no,location=no,status=yes,scrollbars=yes,resizable= yes,width=780,height=580,top=0,left=0');

Any ideas would be greatly appreciated.


02-16-2007, 06:13 PM
print() is a reserved function. Change the name of the function and don't use javascript: in the onclick. Just call the function

02-16-2007, 06:22 PM
That did the trick. Thank you VERY much.