473,399 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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 2439
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.javascript 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="on">Try me!<p> <!-- if IE -->
<script>
document.onselectstart=new Function ("return false"); // if IE4+
if(window.sidebar){document.ondoubleclick=disables elect;} // if NS6
function disableselect(e){return false}
</script>
HTH
Ivo

Jul 23 '05 #3

"Paweł" <pm**@op.pl> wrote in message
news:16****************@www.okozaoko.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='document.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
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...
7
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...
22
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...
11
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
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...
11
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...
11
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....
4
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
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.