Solved

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

Posted on 2008-06-21
5
5,803 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 108

Expert Comment

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

Expert Comment

by:dosth
Comment Utility
<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
Comment Utility
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
Comment Utility
unless or other wise you post the page you cant call a function with vb script.
0
 
LVL 15

Expert Comment

by:dosth
Comment Utility
thanks
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Read about why website design really matters in today's demanding market.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to count occurrences of each item in an array.

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now