Solved

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

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

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

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

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

729 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