Onclick is a client-side event, the browser that you're using is looking in
the source of your page for a function named myvalidate. As you'll see in a
view-source, there is no function with that name. That function only exists
at the server level in the server-side code, and the browser will never have
any knowledge of it. For this particular example, you could do a
document.write (client side code), but I imagine your ultimate goal is to
just test calling a subroutine, not writing "ok."
Getting a grip on client-side code and server-side code is one of the first
steps in ASP. But, if you pretend your the server for a minute, you'll see
that anything that exists outside of server side script blocks (<% %>, for
example) is just a meaningless string of characters, regardless of its
content. That might make sense. I'm a lousy teacher. :]
Ray at home
"Gordon" <go*********@iname.com> wrote in message
news:a2**************************@posting.google.c om...
I'm just getting started in ASP and can't seem to figure out how to
run a function in ASP. I get an error of "Line 11 - Type
Mismatch:'myvalidate'.
Line 11 is the Input Button.
Here is my simple page's code, what's wrong???:
<%@LANGUAGE="VBSCRIPT"%>
<%
sub myvalidate()
response.write("ok")
response.end
end sub
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="">
<input type="text" name="txt">
<input language = "VBSCRIPT" type="button" name="myButton"
value="Button" onClick="Call myvalidate()">
</form>
</body>
</html>