...

View Full Version : ASP runtime error



jun2000
02-18-2009, 02:54 PM
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>

Spudhead
02-18-2009, 03:41 PM
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:



<script language="javascript">

function disable(){
document.getElementById("voidDrawingsChk").disabled=true;
}

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

response.write("disable();")

end if
%>
</script>

shakir
02-23-2009, 01:36 PM
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>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum