473,387 Members | 1,379 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,387 software developers and data experts.

Prevent selection

Hello,

I have a html table in which selection is prevented by using
onselectstart="return false;". This way, the user can't select anything
in the table with the mouse or with the shift+arrow keys.

But in one table cell I need to re-activate the selection possibility
again. I don't know how to do that, adding onselectstart="return true;"
to the cell does not work.

Anyone knows how to do this?

Greetings,
Chris
*** Sent via Developersdex http://www.developersdex.com ***
Jun 27 '08 #1
7 1118
There is another way you could try. Set the following attribute

<td unselectable='on' >

"Chris Zopers" <te***********@12move.nlwrote in message
news:%2******************@TK2MSFTNGP06.phx.gbl...
Hello,

I have a html table in which selection is prevented by using
onselectstart="return false;". This way, the user can't select anything
in the table with the mouse or with the shift+arrow keys.

But in one table cell I need to re-activate the selection possibility
again. I don't know how to do that, adding onselectstart="return true;"
to the cell does not work.

Anyone knows how to do this?

Greetings,
Chris
*** Sent via Developersdex http://www.developersdex.com ***

Jun 27 '08 #2
Hello,

I can't get <td unselectable='on' to work. When I use this, nothing
seems to happen/change.....any ideas?

Greetings,
Chris.
*** Sent via Developersdex http://www.developersdex.com ***
Jun 27 '08 #3
"Chris Zopers" <te***********@12move.nlwrote in message
news:OC****************@TK2MSFTNGP04.phx.gbl...
I can't get <td unselectable='on' to work. When I use this, nothing
seems to happen/change.....any ideas?
I've never got this to work - it's proprietary, for one thing:
http://msdn.microsoft.com/en-us/libr...06(VS.85).aspx

Note specifically: "There is no public standard that applies to this
attribute."
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #4
Well, it works fine using explorer 6 and 7. Excerpt from my code.

slotsBuilder.Append("<td unselectable='On'


"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:O0**************@TK2MSFTNGP06.phx.gbl...
"Chris Zopers" <te***********@12move.nlwrote in message
news:OC****************@TK2MSFTNGP04.phx.gbl...
>I can't get <td unselectable='on' to work. When I use this, nothing
seems to happen/change.....any ideas?

I've never got this to work - it's proprietary, for one thing:
http://msdn.microsoft.com/en-us/libr...06(VS.85).aspx

Note specifically: "There is no public standard that applies to this
attribute."
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #5
"Microsoft Newsserver" <me@nowhere.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...

[top-posting corrected]
>>I can't get <td unselectable='on' to work. When I use this, nothing
seems to happen/change.....any ideas?

I've never got this to work - it's proprietary, for one thing:
http://msdn.microsoft.com/en-us/libr...06(VS.85).aspx

Note specifically: "There is no public standard that applies to this
attribute."

Well, it works fine using explorer 6 and 7.
Yes, it would do - hence "proprietary"...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #6
But you said

"I've never got this to work - it's proprietary, for one thing:" I'm just
letting you know that it does.

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:uP**************@TK2MSFTNGP04.phx.gbl...
"Microsoft Newsserver" <me@nowhere.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...

[top-posting corrected]
>>>I can't get <td unselectable='on' to work. When I use this, nothing
seems to happen/change.....any ideas?

I've never got this to work - it's proprietary, for one thing:
http://msdn.microsoft.com/en-us/libr...06(VS.85).aspx

Note specifically: "There is no public standard that applies to this
attribute."

Well, it works fine using explorer 6 and 7.

Yes, it would do - hence "proprietary"...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #7
Perhaps adding and removing the handler programatically would do the trick.

"Chris Zopers" <te***********@12move.nlwrote in message
news:%2******************@TK2MSFTNGP06.phx.gbl...
Hello,

I have a html table in which selection is prevented by using
onselectstart="return false;". This way, the user can't select anything
in the table with the mouse or with the shift+arrow keys.

But in one table cell I need to re-activate the selection possibility
again. I don't know how to do that, adding onselectstart="return true;"
to the cell does not work.

Anyone knows how to do this?

Greetings,
Chris
*** Sent via Developersdex http://www.developersdex.com ***

Jun 27 '08 #8

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

Similar topics

2
by: Danny | last post by:
I have a combo box look up and list items in a table, it is not bound. It works fine but how can I prevent the users from entering in there own data? i have an 'on change' event that when it...
0
by: Steve | last post by:
The treeview has this habit of scrolling when you change the tree's selection so that the selected item is visible. 9 times out of 10 this is the behavior that you'd want, but what do I do to...
1
by: youngie | last post by:
I've got a listview on a form in report style. It's populated with 40 item. I want to prevent the used clicking on some items, and if the user clicks on one of these items I want the selection to...
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
0
by: Michel Lapointe | last post by:
Hello, I would like to know if there is an event for the Datagridview control that is trigger before the selection change and is cancelable. I'm currently using the SelectionChanged event...
22
by: | last post by:
Hi I really hope that this posting is not a breach of netiquette. I keyed in some code copied from p.530 of The Complete Reference HTML Third Edition which is a popular book. I have listed it...
6
by: Fnord Nase | last post by:
Hi. We're using the dblclick event in some parts of a web app interface, which works okay, but when a user double clicks on a text element, the browser selects some text before executing the...
4
by: since | last post by:
How do I in IE prevent the onclick action from being fired when I am done dragging? have tried "window.event.cancelBubble = true", for onmouseup , onmousedown, and onmousemove handlers. The onclick...
0
by: Rasika WIJAYARATNE | last post by:
Hi everyone, I have two grid-views and I am trying to populate the data on gv2 based on the selection in gv1. However when a row is selected in gv1, it doesn't populate the gv2 with data. I have...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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,...

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.