Thanks
<a href="somepage.htm" onclick= "return somefunction();">Hyperlink</a>
or use the 'JavaScript' url method:
<a href="JavaScript: return somefunction();">Hyperlink</a>
<SCRIPT Language=JavaScript>
function somefunction(){
// do some stuff.
return false; // stops the hyperlink from being actioned.
}
</SCRIPT>
Pay attention to he return value - if you return 'true'; then the hypelink
will still fire and navigate to the href. If you return false then this
action will be cancelled.
Chris Barber.
"D DiPalma" <a@a> wrote in message news:#Hm#W1c$BHA.1540@tkmsftngp02...
window.event.returnValue=false
Her are the whole asp code:
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META name=VI60_defaultClientScript content=VBScript>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<SCRIPT LANGUAGE=vbscript>
<!--
sub link_onclick()
msgbox "You click me"
window.event.returnValue=false
end sub
-->
</SCRIPT>
</HEAD>
<BODY>
<P><A id="link" href="">Click Me</A></P>
</BODY>
</HTML>
Gary
This posting is provided "AS IS", with no warranties, and confers no
rights. Enjoyed ASP.NET? http://www.asp.net