473,811 Members | 2,685 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is it possible to block a mouse event on an Hyperlink with a general script event?

Is it possible to block a mouse event on an Hyperlink with a general
script event?

This is quite troublesome for me. I am trying to find a way to block
the windows shortcut SHIFT + MOUSE LEFT BUTTON that open the Hyperlink
in a new window for a Web application. I just want to capture the Shift
click event and prevent it from opening a new page.

Mouse Wheel didn't pose any problems but the other mouse buttons seems
to ignore the cancelBubble proprety.

I'v seen few messages of people saying that they couldn't not make it
work with IE6 and some answers what it did work with IE5. I couldn't
try on IE5 but I tried it on IE7Beta and it Dindn't work.

As I sayd before, only the mouse button seems to not work. Mouse Wheel
work fine.

It may be because the activation of the event click on an Hypertext
have an higher priority than the event in the code and therefore the
annulation of the bubble is useless since the action have been alredy
launch but if if you add a MsgBox("") in the code, there is no new page
opened.

If anyone have a clue about how to solve my problem I would really
appreciate.

P.S.: A way to pass by this problem could be to remove the SHIFT
modificator and simply open a page the normal way but I coudn't find
anything on that either. (But I don't NEED the page to be open on a
shift click, just blocking the event would be really nice)

<script language="vbscr ipt" for="document" event="onmoused own">
<!--
IF window.event.sh iftKey THEN
window.event.re turnValue = FALSE
window.event.ca ncelBubble = TRUE
END IF
//-->
</script>
<script language="vbscr ipt" for="document" event="onmousec lick">
<!--
IF window.event.sh iftKey THEN
window.event.re turnValue = FALSE
window.event.ca ncelBubble = TRUE
END IF
//-->
</script>
<script language="vbscr ipt" for="document" event="onmouseu p">
<!--
IF window.event.sh iftKey THEN
window.event.re turnValue = FALSE
window.event.ca ncelBubble = TRUE
END IF
//-->
</script>


<script language="vbscr ipt" for="document" event="onmousew heel">
<!--
IF window.event.sh iftKey THEN
window.event.re turnValue = FALSE
window.event.ca ncelBubble = TRUE
END IF
//-->
</script>

Mar 31 '06 #1
1 1958
I forgot to precise, I can't simply add a null event in the <a> since
the links are generated by a DLL and this DLL is used in many
applications.

I know it would have been really easier but I can't do it since too
many other applications depend on it.

Mar 31 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1300
by: Mike | last post by:
I noticed from the msdn help that posting a large message to the event log is a bad practice. Logging a path to a file is better in this instance. Is it possible to send a hyperlink in an event log message that references an XML file that has a processing instruction to be transformed by an XSLT file? I'd like the user to be able to click the hyperlink in the event log and have a formatted html page open in a browser. I would like to do...
2
506
by: cmelnick | last post by:
I need to determine whether the user used the right or left mouse button to click an element on a form. AFAIK, there is no way to determine this from the Click (or DoubleClick) event. I currently have my form set up to have a MouseButtons instance that gets updated by the MouseDown event, then the Click event checks the instance to see if it was right or left. This works fine, but seems a very roundabout and clumsy way to do something...
1
2094
by: seash | last post by:
hi friends I need to call an event (private void groupBox4_Enter(object sender, System.EventArgs e)) from an another event (private void Appexit_Closing(object sender, System.ComponentModel.CancelEventArgs e)),first of all is it possible to call an event from an another event? basically how to call an event? .... hey Philip Rieck r u there --- seash
5
12552
by: OC | last post by:
I would like to trigger another event from within an event that is specific to a forms state at the time of the original event. Is this possible?
2
4992
by: Alex Sedow | last post by:
Why interface-event-declaration does not support multiple declarators like event-declaration? Grammar from C# spec: variable-declarators: variable-declarator variable-declarators "," variable-declarator variable-declarator:
1
1829
by: | last post by:
Hi How can I trigger a button_click event in c#, please? I have tried calling the event directly, but the event was looking for some parameters such as sender and eventarguments which I don't know what to send?! TIA --
0
1847
by: lechatthierry | last post by:
Is it possible to block a mouse event on an Hyperlink with a general script event? This is quite troublesome for me. I am trying to find a way to block the windows shortcut SHIFT + MOUSE LEFT BUTTON that open the Hyperlink in a new window for a Web application. I just want to capture the Shift click event and prevent it from opening a new page. Mouse Wheel didn't pose any problems but the other mouse buttons seems to ignore the...
2
9514
by: cumars | last post by:
Hello Friends, I want to trigger both the click event and double click event in a single button separately. (i.e.) the user can trigger both the single click and the double click event. if they click once, it should trigger single click event. if they click twice, it should trigger double click event. please Help. Cumars
3
21186
by: GauravGupta | last post by:
i want to know that is it posible to call button click event before page load event on post back.... please help me....
0
9727
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10647
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10398
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9204
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7669
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6889
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3865
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.