470,625 Members | 2,042 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,625 developers. It's quick & easy.

How to keep static text from being selected


I have a table of line-style entries, much like webmail. When the user
double-clicks on a line, a box pops up to enter the data for that
entry.

The problem is, whatever word they clicked on in the table is still
selected, as if to be copied or cut. It just looks ugly.

I've seen some IE-only solutions, but none for FF.

Aug 16 '05 #1
6 2888
ASM
jonathon wrote:
I have a table of line-style entries, much like webmail. When the user
double-clicks on a line, a box pops up to enter the data for that
entry.
a prompt I presume ?
The problem is, whatever word they clicked on in the table is still
selected, as if to be copied or cut. It just looks ugly.
selection = '';
in end of prompt function for instance ?
I've seen some IE-only solutions, but none for FF.


on my idea : yes any JS clipboard copy with respectuous browsers

Only M$ allows external users (here the Webmaster)
to play with computer system (clipboard)

would have to read about hackers with this hole in secutity

--
Stephane Moriaux et son [moins] vieux Mac
Aug 16 '05 #2
ASM said the following on 8/16/2005 10:32 AM:
jonathon wrote:
I have a table of line-style entries, much like webmail. When the user
double-clicks on a line, a box pops up to enter the data for that
entry.

a prompt I presume ?


Why does it have to be a prompt? It could just as easily be a dHTML
in-page popup and serve the same purpose.
The problem is, whatever word they clicked on in the table is still
selected, as if to be copied or cut. It just looks ugly.

selection = '';
in end of prompt function for instance ?


If, and only if, selection refers to the range of selected text.
I've seen some IE-only solutions, but none for FF.

on my idea : yes any JS clipboard copy with respectuous browsers


The question had nothing to do with clipboard copy, it had to do with
deselecting a selected word.
Only M$ allows external users (here the Webmaster)
to play with computer system (clipboard)
It's nice to know that Microsoft, and every other browser vendor, has
fixed every security flaw that allows hackers into computers and that
the only security risk left is allowing webmasters to play with the
clipboard.
would have to read about hackers with this hole in secutity


"hole in security" is the ability to de-select text? Please explain.

But JS, in just about any browser, can copy text. I say any becuase
there may exist a browser that doesn't allow the dynamic copying of content.

To the OP: Look in ranges, selection and deselection, of ranges.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Aug 16 '05 #3
ASM
Randy Webb wrote:
ASM said the following on 8/16/2005 10:32 AM:
a prompt I presume ?
Why does it have to be a prompt? It could just as easily be a dHTML
in-page popup and serve the same purpose.


love that *as easily*
selection = '';
in end of prompt function for instance ?


If, and only if, selection refers to the range of selected text.


I hope so :-) (wouldn't selection be the right JS function with FF ?)
The question had nothing to do with clipboard copy, it had to do with
deselecting a selected word.


doesn't matter

--
Stephane Moriaux et son [moins] vieux Mac
Aug 16 '05 #4
ASM said the following on 8/16/2005 2:23 PM:
Randy Webb wrote:
ASM said the following on 8/16/2005 10:32 AM:
a prompt I presume ?

Why does it have to be a prompt? It could just as easily be a dHTML
in-page popup and serve the same purpose.

love that *as easily*


You made a presumption, I asked you to clarify your presumption.
selection = '';
in end of prompt function for instance ?

If, and only if, selection refers to the range of selected text.

I hope so :-) (wouldn't selection be the right JS function with FF ?)


Not of it's own without being qualified.
The question had nothing to do with clipboard copy, it had to do with
deselecting a selected word.


doesn't matter


Quite contrare, it very much matters if you go back and answer the part
of my post that you snipped.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Aug 16 '05 #5
ASM
Randy Webb wrote:
ASM said the following on 8/16/2005 2:23 PM:
Randy Webb wrote:
ASM said the following on 8/16/2005 10:32 AM:

a prompt I presume ?

Why does it have to be a prompt? It could just as easily be a dHTML
in-page popup and serve the same purpose.
love that *as easily*


You made a presumption, I asked you to clarify your presumption.


my presumption was to the OP clarifies its method not to us asking
each other : 'what you said ?'

but ...
I'm very interested in an example in dHTML popup prompt or/and confirm
wouldn't selection be the right JS function with FF ?


Not of it's own without being qualified.


found ! it is getSelection()

it very much matters if you go back and answer the part
of my post that you snipped.


My english is too poor
so you can turn of what I want to say as you need,
and I'm not sure to correctly understand what you tell.
So : no more matter (clipboards, hackers, security and so one)

--
Stephane Moriaux et son [moins] vieux Mac
Aug 17 '05 #6
jonathon wrote:
I have a table of line-style entries, much like webmail. When the user
double-clicks on a line, a box pops up to enter the data for that
entry.

The problem is, whatever word they clicked on in the table is still
selected, as if to be copied or cut. It just looks ugly.


For Internet Explorer you can "return false" in the "onselectstart"
event handler.
For Firefox (and maybe some other browsers) you can "return false" in
the "onmousedown" event handler.

Robert.
Aug 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Daniel Hill | last post: by
2 posts views Thread by Patrick | last post: by
9 posts views Thread by Tarscher | last post: by
9 posts views Thread by LamSoft | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.