Solved

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

Posted on 2008-06-21
5
5,832 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 110

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

628 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