Solved

CSS Button onclick event  href="#" onclick="

Posted on 2008-06-21
5
5,812 Views
Last Modified: 2008-08-04
Ok this is really bugging me. How do you correctly call a procedure from the  href="#" onclick="

eg I want to call
Protected Sub ABC()
from the onclick event of a css button

I have tried
<a class="button" href="#" onclick="ABC();"><span>GO</span></a>

but this doesnt fire the event. I can get a normal button to run the procedure using the onclick event but really want to use the css button to do the same thing.

Thanks in advance
0
Comment
Question by:JOHNFROG
  • 3
5 Comments
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 21837290
Why are you using href="#" ?
0
 
LVL 15

Expert Comment

by:dosth
ID: 21837540
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script>
function ABC(url)
{
alert(ABC);
}
</script>
<body>
<a href="#" onClick="javascript:ABC('http://www.google.com');"><span>GO</span></a>

</body>
</html>
0
 

Author Comment

by:JOHNFROG
ID: 21838847
Thanks dosth but I think my problem is that I am trying to call a proc rather than a function. Should I write the Procedure as a function and call it? Why cant I call the Procedure. I am usung VB in a code behind file if that makes any difference.

Sorry but I am just an old VBA hack trying to get my head around .net
0
 
LVL 15

Accepted Solution

by:
dosth earned 50 total points
ID: 21843852
unless or other wise you post the page you cant call a function with vb script.
0
 
LVL 15

Expert Comment

by:dosth
ID: 22152304
thanks
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
specific questions about shipping a coat 4 43
Shopping Cart 2 75
Select only the top record in a left join 13 37
Syntax for query to update table 2 15
Find out what you should include to make the best professional email signature for your organization.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question