473,581 Members | 2,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I prevent user from selecting text??

I'm desinging a graphical interface and I frequently
take advantage of the double click event. Unfortunately in most browsers
double clicking also involves selecting and I would like to avoid that
since whatever is selected has dark blue background and white letters what
spoils the whole visual effect.... Any way I can block it por avoid it?
Jul 23 '05 #1
3 2448
Pawe³ wrote:
I'm desinging a graphical interface and I frequently
take advantage of the double click event. Unfortunately in most browsers
double clicking also involves selecting and I would like to avoid that
since whatever is selected has dark blue background and white letters what
spoils the whole visual effect.... Any way I can block it por avoid it?


No.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Jul 23 '05 #2
Ivo
Pawe³ asked
I'm desinging a graphical interface and I frequently
take advantage of the double click event. Unfortunately in most browsers
double clicking also involves selecting and I would like to avoid that
since whatever is selected has dark blue background and white letters what
spoils the whole visual effect.... Any way I can block it por avoid it?


Not in all browsers:
<p unselectable="o n">Try me!<p> <!-- if IE -->
<script>
document.onsele ctstart=new Function ("return false"); // if IE4+
if(window.sideb ar){document.on doubleclick=dis ableselect;} // if NS6
function disableselect(e ){return false}
</script>
HTH
Ivo

Jul 23 '05 #3

"Pawe³" <pm**@op.pl> wrote in message
news:16******** ********@www.ok ozaoko.pl...
I'm desinging a graphical interface and I frequently
take advantage of the double click event. Unfortunately in most browsers
double clicking also involves selecting and I would like to avoid that
since whatever is selected has dark blue background and white letters what
spoils the whole visual effect.... Any way I can block it por avoid it?


In the body tag, use the ondblclick event to focus an insignificant form
element:

<body ondblclick='doc ument.forms[0].elements[1].focus()'>

I can't be selected with a double click.<BR><BR>

<form>
<textarea cols=30 rows=2 >Just try selecting me with a double
click...</textarea>
<input type=text size=1>
</form>

</body>

--
Jul 23 '05 #4

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

Similar topics

7
6606
by: Mike Lopez | last post by:
Hello. I need to set a checkbox to the "checked" state and prevent the user from unchecking it. I tried using "disabled", but then the value is not passed on the Post to an ASP page. Anyone have any ideas? Thanks in advance,
7
6822
by: JimO | last post by:
I teach HS computers and one of my kids has a web site with a textbox of info that the user can scroll down and read. The problem is that users can also enter text into it. Is there a way, or a better control, method, to prevent user from entering text? Thanks, Jim
22
7555
by: alecjames1 | last post by:
I have a form which the user must complete before closing. I have disabled the window x button and use my own exit button. When selected it checks to see if the user has completed the entries otherwise it cancels the close. However, the user can still right click on the task bar and close my application. Is there any way of preventing this....
11
3042
by: moondaddy | last post by:
I have images that I need to prevent the user from doing a right click and selecting "Save Picture As"? How can I do this? -- moondaddy@nospam.com
0
1678
by: clintonG | last post by:
I applied aspnet_regsql to SQL2K which was working fine throughout Beta 2 development. After installing Visual Studio and SQL Express RTM my application has blown up. Logging in to the application became realllllllllllly slow. Content in LoginView Role Groups was not displaying even after a user in a role had logged in. It was taking about...
11
2163
by: RobKinney1 | last post by:
Hello, I am looking for a clever way to prevent someone from pasting copied text outside of my app. I know how to monitor the clipboard and get an WM_DRAWCLIPBOARD message when text is stored in the clipboard... If only I could detect some kind of outgoing message that the clipboard is about to paste, then I could check to see if my app...
11
4206
by: bill | last post by:
I dynamically create buttons and associate them with an event using AddHandler. I want all the button events to fire at one time, when the page is posted, instead of when each button is clicked. How I stop the buttons from posting back when they are clicked? Thanks
4
2141
by: PJ6 | last post by:
Is there a way to prevent the double-click event on an element from causing IE6 to select everything? Cancelling the event doesn't work. Paul
0
1006
by: Alan Mailer | last post by:
I have a ListView in one of my VB.Net applications. I don't want to Disable this ListView... but there are times I want to prevent the User from selecting a ListView Item other than the one that is already selected. Other than disabling a ListView, how else can I prevent the User from selecting a different item in the ListView. Thanks...
0
7868
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...
0
7792
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...
0
8149
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. ...
0
8304
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...
1
7899
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...
0
6553
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...
1
5674
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...
0
5364
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...
0
3827
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.