473,775 Members | 2,625 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cancelling shift-left-click event

I am developing a calendar on which dates can be clicked and selected.
A calendar is a table in which each day is a cell. Each cell has a
unique id.

By left-clicking on a date, it gets selected (with a blue background).
By then shift-left-clicking on another date, the range between the
first and second dates gets selected. This is a behavior commonly found
on GUI widgets. Therefore, I need to cancel the onMouseDown event so
the browser does not select the text by responding to shift-left-click
event. If I don't, the date cells get selected, but so is the text.

Simply returning false from the event handler works for Firefox but
doesn't for Internet Explorer 6. I tried setting cancelBubble to true
and returnValue to false to no avail. However, displaying an alert()
window prevents the selection, though I do not know if this is an
artifact from the window losing the focus. A post in this group
(http://tinyurl.com/g5au4) stated that "the alert is necessary for the
'return false' to properly work".

Setting a timer from onMouseDown to clear the selection does work, but
the selection is visible on screen for a fraction of second before
getting cleared. That's not a viable solution for me.

How do I prevent Internet Explorer (5.5+ if possible) from selecting
text when the user left-clicks with the shift key pressed?

Thank you,
Jonathan

Jun 18 '06 #1
1 3543
jo************* **@gmail.com wrote:
I am developing a calendar on which dates can be clicked and selected.
A calendar is a table in which each day is a cell. Each cell has a
unique id.

By left-clicking on a date, it gets selected (with a blue background).
By then shift-left-clicking on another date, the range between the
first and second dates gets selected. This is a behavior commonly found
on GUI widgets. Therefore, I need to cancel the onMouseDown event so
the browser does not select the text by responding to shift-left-click
event. If I don't, the date cells get selected, but so is the text.

Simply returning false from the event handler works for Firefox but
doesn't for Internet Explorer 6. I tried setting cancelBubble to true
and returnValue to false to no avail. However, displaying an alert()
window prevents the selection, though I do not know if this is an
artifact from the window losing the focus. A post in this group
(http://tinyurl.com/g5au4) stated that "the alert is necessary for the
'return false' to properly work".

Setting a timer from onMouseDown to clear the selection does work, but
the selection is visible on screen for a fraction of second before
getting cleared. That's not a viable solution for me.

How do I prevent Internet Explorer (5.5+ if possible) from selecting
text when the user left-clicks with the shift key pressed?


Was that question off-topic or a faq? This newsgroup seems to be very
active and no answer could mean that's not a question you'd want to
answer or it was too difficult... just kiddin'.

Thanks for everybody's time anyways.
Jonathan

Jun 20 '06 #2

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

Similar topics

5
2365
by: Alex Stevens | last post by:
Hi All, I'm writing a launcher program which checks for updates and copies them down to the client. However, I would like the user to be able to modify the settings for the launcher. As this runs automatically, I would like it to be configurable by the user holding down the shift key when double-clicking my exe, to bypass the usual update routine and start the config form. Access does something similar, by holding down the shift to...
3
1488
by: mgw | last post by:
Hi, I'm trying to cancel the Shift+F3 key combination in Netscape 7.2 from performing the F3 key's default action of opening the Find dialog. I'm unable thus far to prevent the Find dialog from appearing after following steps listed in numerous posts in this group. I detect the onkeydown event of the body as follows: <body onkeydown="return bodyOnKeyPress(event);">
6
3742
by: PerryC | last post by:
I have search googles and there are hundreds of tips about AllowByPassKey... however, none works for me... well, perhaps I am too new to such high level functionality that it just does not make sense to me. So, anyone please help. I have no idea what is "CreateProperty" that Access help was trying to tell me to do. Can anyone please write me a step by step on how to accomplish this? (i.e. disable Shift on Startup.) I've seen many...
388
21926
by: maniac | last post by:
Hey guys, I'm new here, just a simple question. I'm learning to Program in C, and I was recommended a book called, "Mastering C Pointers", just asking if any of you have read it, and if it's worth the $25USD. I'm just looking for a book on Pointers, because from what I've read it's one of the toughest topics to understand. thanks in advanced.
1
3382
by: Ajab Gajab | last post by:
Hi All, I am developing an application in VB.Net where I need to provide user with cancelling or stopping the current print job. Like, if a user clicks on "stop" button, then printer should print already processed contents of a page. This can be easily achieved in VB.Net by using e.HasMorePages = False. However, if a user clicks on "Cancel" button, the printer should terminate the current job immedialtely without printing processed...
2
2626
by: Mark Anderson | last post by:
Is it possible to identify the action of a user cancelling by the user of file download dialog? (as opposed to something else being captured. Ideally I'd like to do this for a IE6+/FF v1.5+/Safari v1.2+ base. [I've a pass through ASP page capturing calls to a download component that doesn't logs activity and which I can't edit. As my ASP page logs the calls before download, a cancel by the user means the d/l count is 1 too high. As this...
3
4200
by: Amy Smith | last post by:
Hello there, I am having a small problem which been challenging me for few days and need help or advice. I am trying to calculate the day-shift for employees based on the time they started and finish working, I will only have 2 shifts 1 or 2 . Shift one changes based on the location however any thing else is shift 2. The problem I am having is when someone signed in after midnight; I need to report his time under shift 2 for the...
2
2548
by: ruthie | last post by:
Hi, I have a gridview with edit option. If the user chooses to edit the row and then press the Cancel button - I would like the focus to return to the chosen row. Someone has any idea how to implement it? Thanks. Regards,
2
2048
by: maralfarshadi | last post by:
Hi I have a hyperlink in my form, and I am using: <a href="javascript:myFunction('myTextBox','myFormName','ServletName')"> Go </a> In my Javascript code, if all goes well, the form gets submitted and the page is forwarded to a servlet. If not, it should just alert the user and cancel the navigation.
0
9454
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
10268
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...
0
10107
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8939
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
7464
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
5486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4017
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
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2853
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.