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
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ASP runtime error

    Hi,

    While I run this ASP code, it says Microsoft VBScript runtime (0x800A000D)
    Type mismatch: 'disable'. I do not know why. Does anyone give me a help?

    Thanks


    <%
    if (request.querystring("voidDrawingList")="noVoid") then
    disable()
    end if
    %>

    <script language="javascript">
    function disable()
    {
    document.getElementById("voidDrawingsChk").disabled=true;
    }
    </script>

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Ok, you're making a fundamental mistake in how you see ASP working.

    ASP works SERVER-SIDE. The server reads the ASP file, does all the ASP stuff, then sends the resulting code back to the browser. It doesn't know or care about the code that it's sending back.

    Your javascript is CLIENT-SIDE. It doesn't know or care about the ASP code that produced it.

    So: you can't call a client-side function from server-side code.

    What you CAN do is get the server-side code to write different client-side code.

    So you can do something like this:


    Code:
    <script language="javascript">
    
    function disable(){
    	document.getElementById("voidDrawingsChk").disabled=true;
    }
    
    <%
    if (request.querystring("voidDrawingList")="noVoid") then
    
    	response.write("disable();")
    
    end if 
    %>
    </script>

  • #3
    Regular Coder
    Join Date
    Nov 2007
    Posts
    110
    Thanks
    0
    Thanked 1 Time in 1 Post
    U r calling server side function but th edunction is in client side Do the following
    <%
    if (request.querystring("voidDrawingList")="noVoid") then
    %>
    <script language="javascript">
    disable()
    </script>
    <%
    end if
    %>

    <script language="javascript">
    function disable()
    {
    document.getElementById("voidDrawingsChk").disabled=true;
    }
    </script>


  •  

    Posting Permissions

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