473,511 Members | 13,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

simple button to run function = type mismatch

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>
Jul 19 '05 #1
1 5691
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>

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3076
by: Digital Puer | last post by:
I have the following HTML form: - radio button A (default selected) - radio button B - input field, of type "file" with "Choose" button - submit button I would like to have it so that if the...
1
3634
by: j.mandala | last post by:
I created a simple link between two tables in a query. TableA has Social Security numbers stored as Long Integer Data. (I imported this table). The Join is between these two fields Table ...
4
6013
by: Andy_Khosravi | last post by:
Hello, I'm having a problem with the MID function within Access 97. I have been trying to build a function to check to make sure that a field on a form does not have any spaces or dashes. This...
0
7537
by: Tal Sharfi | last post by:
Hi everyone I recently had the need for StringGrid object same as the one that Delphi has. An object that helps show lists of other objects in a simple grid. I searched the news groups and...
27
4584
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
24
6286
by: firstcustomer | last post by:
Hi, Firstly, I know NOTHING about Javascript I'm afraid, so I'm hoping that someone will be able to point me to a ready-made solution to my problem! A friend of mine (honest!) is wanting to...
0
1058
by: indhu | last post by:
hi i am creating a form with 3 cmd buttons using some image on that so that it looks like animated. 2 images and 2 label and 1 cmd button these 3 acts like a animated button. i ve given the...
19
3802
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
3
1418
by: Whizzo | last post by:
Hi folks; I've only really started to use VB for important stuff quite recently, and SQL is still quite alien to me. I'm finding the syntax a real pain to get the hang of, at the moment it's just a...
0
7251
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7148
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7430
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7089
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5673
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5072
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1581
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
451
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.