Solved

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

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

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.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to count occurrences of each item in an array.

912 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

22 Experts available now in Live!

Get 1:1 Help Now