Don't want text to be marked when clicking multiple times on it

T

tonicvodka

Hi all!


I've made a table over all the weeks in a year in a table. Where the
week number is inside the td tag.


When you want to reserve a certain week you click on it once and it
changes color to blue for preliminary, clicking it twice makes it
red(booked) and a third time brings it back to green(available). The
problem is the number inside the cell gets marked when you are clicking

it. Is there a way to prevent this?
 
S

Safalra

I've made a table over all the weeks in a year in a table. Where the
week number is inside the td tag.
When you want to reserve a certain week you click on it once and it
changes color to blue for preliminary, clicking it twice makes it
red(booked) and a third time brings it back to green(available). The
problem is the number inside the cell gets marked when you are clicking
it. Is there a way to prevent this?

You mean that the browser makes the text selected? This is a user
interface feature, and I don't think it can be overridden in any
cross-browser manner. (Perhaps a nasty hack like CSS positioning a
transparent element over the cells and detecing clicks on that element
rather than the text below would work, but I wouldn't recommend it.)
 
T

tonicvodka

Thanks for your response Safalra! I think you've understood my problem
correctly.
I'll repost my question asking for suggestions instead, hope you look
at that one too:)
 
S

Si

When you want to reserve a certain week you click on it once and it
changes color to blue for preliminary, clicking it twice makes it
red(booked) and a third time brings it back to green(available). The
problem is the number inside the cell gets marked when you are clicking

it. Is there a way to prevent this?
If i remember correctly, the following should work, just typed without
checking.
<body onselectstart="return false" ondragstart="return false">
Also, unreliable accross browsers and js on/off.

Also, any other methods can be used to select the text, so probably not
much point using it.

HTH

Si
 
S

Si

Si said:
If i remember correctly, the following should work, just typed without
checking.
<body onselectstart="return false" ondragstart="return false">
Also, unreliable accross browsers and js on/off.

Also, any other methods can be used to select the text, so probably not
much point using it.

HTH

Si

Bit quick on hitting send there, just seen what you really want, don't
think the above code is of anyuse at all as it will disable the clicking
on the text as you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top