Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    215
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Object doesn't support this property or method

    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:

    Code:
    "Object doesn't support this property or method"
    Here is the code:

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

    Code:
    <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');
    }
    </script>
    Any ideas would be greatly appreciated.

    Parallon

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    print() is a reserved function. Change the name of the function and don't use javascript: in the onclick. Just call the function
    onclick="printit(document.mainForm)"
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    May 2005
    Posts
    215
    Thanks
    14
    Thanked 0 Times in 0 Posts
    That did the trick. Thank you VERY much.

    Parallon


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •