F
foldface
Hi
I have a table and I've been trying to find a way to stop the text
in the
table being selectable.
One article nearly works for me:
http://groups.google.co.uk/groups?h...306291340.629e932%40posting.google.com&rnum=6
But not quite. The code below shows my problem:
<table width=50% border=groove>
<tr OnMouseDown='OnMouseDown()'>
<td>hi</td>
</tr>
</table>
<script>
function OnMouseDown() {
var obj = window.event.srcElement;
var r = document.body.createTextRange();
r.moveToElementText(obj);
r.select();
return true;
}
</script>
This code seems to stop the selection by effectively selecting the
text before hand, selecting text twice == select/unselect. The problem
is when you press
the ctrl key then selecting the text twice == select/select, i.e. it
stays selected.
So all I want to do is stop text being selected when the ctrl key is
pressed,
any ideas?
Thanks
F
I have a table and I've been trying to find a way to stop the text
in the
table being selectable.
One article nearly works for me:
http://groups.google.co.uk/groups?h...306291340.629e932%40posting.google.com&rnum=6
But not quite. The code below shows my problem:
<table width=50% border=groove>
<tr OnMouseDown='OnMouseDown()'>
<td>hi</td>
</tr>
</table>
<script>
function OnMouseDown() {
var obj = window.event.srcElement;
var r = document.body.createTextRange();
r.moveToElementText(obj);
r.select();
return true;
}
</script>
This code seems to stop the selection by effectively selecting the
text before hand, selecting text twice == select/unselect. The problem
is when you press
the ctrl key then selecting the text twice == select/select, i.e. it
stays selected.
So all I want to do is stop text being selected when the ctrl key is
pressed,
any ideas?
Thanks
F