How to disable the feature to select a text

Discussion in 'HTML' started by Stefan Mueller, Dec 21, 2009.

  1. I've a HTML table with several columns. If you click on the header of
    a column the appropriate column gets sorted.
    If you move the mouse while clicking the header or you even double
    click the header the text in the header gets selected.

    Is there any possibility to disable this feature so that the text in
    the header never gets selected?
     
    Stefan Mueller, Dec 21, 2009
    #1
    1. Advertising

  2. Stefan Mueller

    Andy Guest

    "Stefan Mueller" <> wrote in message
    news:...
    > I've a HTML table with several columns. If you click on the header of
    > a column the appropriate column gets sorted.
    > If you move the mouse while clicking the header or you even double
    > click the header the text in the header gets selected.
    >
    > Is there any possibility to disable this feature so that the text in
    > the header never gets selected?


    You could place an absolute positioned div within a relative positioned div
    (which contains your heading) then use a 100% height by 100% width blank
    image in the absolute div as your link (onclick) anchor.

    This would also have the advantage of making the entire heading container
    clickable and not just the text.

    If you need me to mock up a working example, let me know.


    Andy
     
    Andy, Dec 21, 2009
    #2
    1. Advertising

  3. Stefan Mueller

    rf Guest

    "Stefan Mueller" <> wrote in message
    news:...
    > I've a HTML table with several columns. If you click on the header of
    > a column the appropriate column gets sorted.
    > If you move the mouse while clicking the header or you even double
    > click the header the text in the header gets selected.


    Yes. That is how browsers work.

    > Is there any possibility to disable this feature so that the text in
    > the header never gets selected?


    No.

    Well, acutally, not with HTML but there is a way with heaps of javascript
    but why does this actually give you a problem?
     
    rf, Dec 21, 2009
    #3
  4. > You could place an absolute positioned div within a relative positioned div
    > (which contains your heading) then use a 100% height by 100% width blank
    > image in the absolute div as your link (onclick) anchor.
    >
    > This would also have the advantage of making the entire heading container
    > clickable and not just the text.
    >
    > If you need me to mock up a working example, let me know.


    Sounds great.
    I'd appreciate it very much if you could post a working example.
     
    Stefan Mueller, Dec 21, 2009
    #4
  5. rf wrote:

    > "Stefan Mueller" <> wrote in message
    > news:...
    >> I've a HTML table with several columns. If you click on the header of
    >> a column the appropriate column gets sorted.
    >> If you move the mouse while clicking the header or you even double
    >> click the header the text in the header gets selected.

    >
    > Yes. That is how browsers work.


    Really? Are you sure you are referring to web browsers and not some
    spreadsheet programs?

    When I mouse over or click on a column header, nothing happens, unless
    there's a link there, or something. If I double click on it, a word gets
    selected - nothing more. If I triple click, the entire header gets selected.
    Still no sorting - and I really don't expect any sorting, as how could a
    stupid wowser know that the user wants to sort? How could it figure out the
    sorting order?

    >> Is there any possibility to disable this feature so that the text in
    >> the header never gets selected?

    >
    > No.


    Huh? How do you _enable_ it in the first place?

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Dec 21, 2009
    #5
  6. Sherm Pendley wrote:

    > "Jukka K. Korpela" <> writes:
    >
    >> rf wrote:
    >>
    >>> "Stefan Mueller" <> wrote in message
    >>> news:...
    >>>> I've a HTML table with several columns. If you click on the header
    >>>> of a column the appropriate column gets sorted.
    >>>> If you move the mouse while clicking the header or you even double
    >>>> click the header the text in the header gets selected.
    >>>
    >>> Yes. That is how browsers work.

    >>
    >> Really? Are you sure you are referring to web browsers and not some
    >> spreadsheet programs?

    >
    > Get a grip. Rf is obviously referring to the selection behavior, not
    > to the sorting behavior.


    There's nothing obvious in it. "Rf" quoted text that discussed both things,
    so it is fair to expect that he commented on both of them, not just one part
    of the second thing - especially since "rf" did not in any way indicate
    otherwise. In adequate quoting, you quote only the part that is necessary
    for indicating what is commented on.

    Besides, in normal browsers, double clicking selects a word - it takes a
    triple click to select a larger part of text. For a single-word header,
    there is no difference, but the discussion was at a general level, and at
    the general level, the common browser behavior is that the clicked _word_
    gets selected.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
     
    Jukka K. Korpela, Dec 21, 2009
    #6
  7. Stefan Mueller

    dorayme Guest

    In article <NgOXm.54392$>,
    "Jukka K. Korpela" <> wrote:

    > rf wrote:
    >
    > > "Stefan Mueller" <> wrote in message
    > > news:...
    > >> I've a HTML table with several columns. If you click on the header of
    > >> a column the appropriate column gets sorted.
    > >> If you move the mouse while clicking the header or you even double
    > >> click the header the text in the header gets selected.

    > >
    > > Yes. That is how browsers work.

    >
    > Really? Are you sure you are referring to web browsers and not some
    > spreadsheet programs?
    >


    The OP gave no url and it is hard to know what he was referring to,
    perhaps he is somehow involved in a page with scripting? Certainly no
    web browser simply sorts anything. The only other column/row sorting way
    is to make things in the TH links to other html pages where the items
    are differently (statically) arranged (I did this static once so people
    could look at Australian towns by postcode or by alphabetical order)


    > When I mouse over or click on a column header, nothing happens, unless
    > there's a link there, or something. If I double click on it, a word gets
    > selected - nothing more. If I triple click, the entire header gets selected.
    > Still no sorting - and I really don't expect any sorting, as how could a
    > stupid wowser know that the user wants to sort? How could it figure out the
    > sorting order?
    >
    > >> Is there any possibility to disable this feature so that the text in
    > >> the header never gets selected?

    > >
    > > No.

    >
    > Huh? How do you _enable_ it in the first place?


    Good question and exactly what I was thinking too. OP is not telling us
    something!

    --
    dorayme
     
    dorayme, Dec 21, 2009
    #7
  8. Stefan Mueller

    dorayme Guest

    In article <>,
    Sherm Pendley <> wrote:

    ....
    > It's patently obvious to anyone who doesn't have a preconceived notion
    > that everyone else in the world is a drooling moron, and a pathological
    > need to "prove" it.
    >


    > Like I said - get a grip.



    Sherm! This is really way out of line, you are being so horrid and
    unfair! JK has done nothing at all in this thread to deserve this.

    --
    dorayme
     
    dorayme, Dec 21, 2009
    #8
  9. Stefan Mueller

    rf Guest

    "dorayme" <> wrote in message
    news:...
    > In article <>,
    > Sherm Pendley <> wrote:
    >
    > ...
    >> It's patently obvious to anyone who doesn't have a preconceived notion
    >> that everyone else in the world is a drooling moron, and a pathological
    >> need to "prove" it.
    >>

    >
    >> Like I said - get a grip.

    >
    >
    > Sherm! This is really way out of line, you are being so horrid and
    > unfair! JK has done nothing at all in this thread to deserve this.


    Get a grip dorayme. JK is a fucking pedantic idiot and this thread simply
    proves it.
     
    rf, Dec 21, 2009
    #9
  10. Stefan Mueller

    rf Guest

    "dorayme" <> wrote in message
    news:...
    > In article <NgOXm.54392$>,
    > "Jukka K. Korpela" <> wrote:
    >
    > >> If you move the mouse while clicking the header or you even double
    >> >> click the header the text in the header gets selected.


    >> Huh? How do you _enable_ it in the first place?

    >
    > Good question and exactly what I was thinking too. OP is not telling us
    > something!


    Move mouse to somewhere over some text. Press mouse button. Move mouse.
    Release mouse button. Admire selected text. Pretty bloody obvious to me.
     
    rf, Dec 21, 2009
    #10
  11. Stefan Mueller

    dorayme Guest

    In article <kNTXm.63851$>,
    "rf" <> wrote:

    > "dorayme" <> wrote in message
    > news:...
    > > In article <>,
    > > Sherm Pendley <> wrote:
    > >
    > > ...
    > >> It's patently obvious to anyone who doesn't have a preconceived notion
    > >> that everyone else in the world is a drooling moron, and a pathological
    > >> need to "prove" it.
    > >>

    > >
    > >> Like I said - get a grip.

    > >
    > >
    > > Sherm! This is really way out of line, you are being so horrid and
    > > unfair! JK has done nothing at all in this thread to deserve this.

    >
    > Get a grip dorayme. JK is a fucking pedantic idiot and this thread simply
    > proves it.


    He is not being any more pedantic than any reasonable poster might be
    nor idiotic, and this thread proves no such thing.

    Formerly, you did nothing wrong, it was a simple matter of you probably
    saying something true (as you often do) but it was unclear enough to
    justify what was a perfectly polite and ordinary querying response from
    JK.

    Sherm was extraordinary in his vituperation and you are now surprising
    me no end! Don't you scripting guys ever forgive and forget? You are
    both misreading him on this occasion and being unfair. If you have
    gripes from the past, keep them as ammo and dry for where they might be
    more appropriate.

    A grip? I know a dirty variation on an advertizing jingle for an
    Australian glue called Tarzan's Grip, it used to go:

    "Get a tube of Tarzan's Grip"

    --
    dorayme
     
    dorayme, Dec 22, 2009
    #11
  12. Stefan Mueller

    dorayme Guest

    In article <0RTXm.63856$>,
    "rf" <> wrote:

    > "dorayme" <> wrote in message
    > news:...
    > > In article <NgOXm.54392$>,
    > > "Jukka K. Korpela" <> wrote:
    > >
    > > >> If you move the mouse while clicking the header or you even double
    > >> >> click the header the text in the header gets selected.

    >
    > >> Huh? How do you _enable_ it in the first place?

    > >
    > > Good question and exactly what I was thinking too. OP is not telling us
    > > something!

    >
    > Move mouse to somewhere over some text. Press mouse button. Move mouse.
    > Release mouse button. Admire selected text. Pretty bloody obvious to me.


    Not in the original context and mixed up with changes of order... It is
    amazing how things appear to you if you know what you mean and also in
    hindsight to others...

    As it happens, clicking and moving mouse does *not* guarantee the text
    gets selected, you have to do a certain amount of moving. Just think
    about it in detail: The OP talks about moving the mouse possibly in the
    context of column sorting so maybe someone reading this is simply not
    thinking "ah text selection!" Text selection requires a bit more than
    just moving the mouse a bit. What has text selection got to do with
    anything? Why is selection needing to be disabled?

    --
    dorayme
     
    dorayme, Dec 22, 2009
    #12
  13. Stefan Mueller

    rf Guest

    "dorayme" <> wrote in message
    news:...
    > In article <kNTXm.63851$>,
    > "rf" <> wrote:
    >
    >> "dorayme" <> wrote in message
    >> news:...
    >> > In article <>,
    >> > Sherm Pendley <> wrote:
    >> >
    >> > ...
    >> >> It's patently obvious to anyone who doesn't have a preconceived notion
    >> >> that everyone else in the world is a drooling moron, and a
    >> >> pathological
    >> >> need to "prove" it.
    >> >>
    >> >
    >> >> Like I said - get a grip.
    >> >
    >> >
    >> > Sherm! This is really way out of line, you are being so horrid and
    >> > unfair! JK has done nothing at all in this thread to deserve this.

    >>
    >> Get a grip dorayme. JK is a fucking pedantic idiot and this thread simply
    >> proves it.

    >
    > He is not being any more pedantic than any reasonable poster might be
    > nor idiotic, and this thread proves no such thing.
    >
    > Formerly, you did nothing wrong, it was a simple matter of you probably
    > saying something true (as you often do) but it was unclear enough to
    > justify what was a perfectly polite and ordinary querying response from
    > JK.


    Bullshit. Nothing is unclear. The subject of this thread is "How to diable
    the feature to select a text". How bloody unclear is that? The OP doesn't
    want text selected. Now, read the OPs further words:

    "the text in the header gets selected" and "is there any possiblility do
    disable this feature so the text [in the header] never gets selected".
    Selected. How does text get selected? By clicking and moving the mouse, just
    like it gets selected in just about every bloody program out there. The OP
    doesn't want that. That was what I was commenting on, not the bloody price
    of tea.

    So, we are clearly talking about selecting text here. I have no fucking idea
    what Korpella was talking about, except that in his usual pedantic way he
    comes over as a complete arsehole.
     
    rf, Dec 22, 2009
    #13
  14. Stefan Mueller

    rf Guest

    "rf" <> wrote in message
    news:u6VXm.63866$...

    > So, we are clearly talking about selecting text here. I have no fucking
    > idea what Korpella was talking about, except that in his usual pedantic
    > way he comes over as a complete arsehole.


    And here are you defending him.
     
    rf, Dec 22, 2009
    #14
  15. Stefan Mueller

    rf Guest

    "dorayme" <> wrote in message
    news:...
    > In article <0RTXm.63856$>,
    > "rf" <> wrote:
    >
    >> "dorayme" <> wrote in message
    >> news:...
    >> > In article <NgOXm.54392$>,
    >> > "Jukka K. Korpela" <> wrote:
    >> >
    >> > >> If you move the mouse while clicking the header or you even double
    >> >> >> click the header the text in the header gets selected.

    >>
    >> >> Huh? How do you _enable_ it in the first place?
    >> >
    >> > Good question and exactly what I was thinking too. OP is not telling us
    >> > something!

    >>
    >> Move mouse to somewhere over some text. Press mouse button. Move mouse.
    >> Release mouse button. Admire selected text. Pretty bloody obvious to me.

    >
    > Not in the original context and mixed up with changes of order... It is
    > amazing how things appear to you if you know what you mean and also in
    > hindsight to others...
    >
    > As it happens, clicking and moving mouse does *not* guarantee the text
    > gets selected, you have to do a certain amount of moving. Just think
    > about it in detail: The OP talks about moving the mouse possibly in the
    > context of column sorting so maybe someone reading this is simply not
    > thinking "ah text selection!" Text selection requires a bit more than
    > just moving the mouse a bit. What has text selection got to do with
    > anything? Why is selection needing to be disabled?


    Does the word "select" have any meaning to you? The OP is complaining about
    text being "selected". How the bloody hell can text be selected if one has
    not moved the mouse far enough to select text? And if the OP has not moved
    the mouse far enough to have selected text then why would he be complaining
    about text being selected?

    Arguing for the sake of arguing I think. You are becoming as big a bloody
    pedant as Korpela is.
     
    rf, Dec 22, 2009
    #15
  16. Stefan Mueller

    dorayme Guest

    In article <u6VXm.63866$>,
    "rf" <> wrote:

    > Bullshit. Nothing is unclear. The subject of this thread is "How to diable
    > the feature to select a text".


    It is an odd thing to announce this as *a feature*, it is so second
    nature. If someone asks, how do you turn the sun off, you don't simply
    go on to answer (unless, maybe, you are Superman). It just seems
    surprising! Bundled with column sorting (the other thing mentioned
    practically in the first breath of the OP's post), I say it can create a
    haze in which normally intelligent beings can get a bit disorientated.
    ....
    > I have no fucking idea
    > what Korpella was talking about, except that in his usual pedantic way he
    > comes over as a complete arsehole.


    He did not, you must be thinking of other threads and it is influencing
    you. A bit of pedantry is not so bad and it needs to be contrasted with
    its opposite - please God, let someone ask me what the opposite of
    pedantry is - to get a better appreciation of it. I think pedantry has
    had an altogether unfair press for a long time. Pedantry does not make
    for arseholiness all by itself. Be fair, Richard!

    --
    dorayme
     
    dorayme, Dec 22, 2009
    #16
  17. Gazing into my crystal ball I observed Stefan Mueller
    <> writing in news:4d3504c9-aa43-402d-bcf4-
    :

    > I've a HTML table with several columns. If you click on the header of
    > a column the appropriate column gets sorted.
    > If you move the mouse while clicking the header or you even double
    > click the header the text in the header gets selected.
    >
    > Is there any possibility to disable this feature so that the text in
    > the header never gets selected?
    >


    You really did not give us enough to go on, certainly a URL would have
    helped, and here you got some of the best regulars around here not being
    very nice to each other.

    So, I'm going to put on my crystal ball hat and guess at what you are
    trying to do/not do.

    1. You cannot sort an HTML table without some kind of client side or
    server side scripting invovled. Simply clicking on text will indeed
    select it - that is the way it's supposed to be.

    2. There is probably a href somewhere that uses a querystring to tell
    either the server side script or a client side script to sort the data
    when that link is clicked. Perhaps something like
    http://example.com/table.php?sort=1

    If it is clearly a link, then users will click on it. If it is not
    clear, and they are clicking somewhere else, you might have that select
    text behaivor.

    Really, without a URL it is impossible for me to go any further.


    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne Boswell, Dec 22, 2009
    #17
  18. Stefan Mueller

    dorayme Guest

    In article <OcVXm.63868$>,
    "rf" <> wrote:

    > "dorayme" <> wrote in message
    > news:...

    ....
    > >>
    > >> Move mouse to somewhere over some text. Press mouse button. Move mouse.
    > >> Release mouse button. Admire selected text. Pretty bloody obvious to me.

    > >

    ....
    >
    > Does the word "select" have any meaning to you? ...


    I was thinking of your words not the OP's at this point. I followed your
    instructions and nothing happened. I trusted you!
    >
    > Arguing for the sake of arguing I think.


    er... maybe a little with you yes... <g>

    But I was really pissed off when I saw Sherm be so incredibly reactive
    (to put it politely). I have nothing against Sherm, he uses Macs, his
    seemed like such an unnecessarily angry response.

    Plus, I don't like to see someone who has contributed so magnificently
    to the world of HTML and CSS be hounded when he is *not* doing anything
    to deserve it. This is 21st Century, not the 13th. Why don't you and
    Sherm grab Jerry Stuckle and have some fun with him, he always deserves
    the stocks and rotting tomatoes thrown at him...

    Around Xmas maybe a little more anger management, lads!

    > You are becoming as big a bloody
    > pedant as Korpela is.


    That is a horrible thing to say! He is not even in my league in this
    pedantry business, he is too serious for that and every year I get the
    silver cup... <g>

    --
    dorayme
     
    dorayme, Dec 22, 2009
    #18
  19. Stefan Mueller

    dorayme Guest

    In article <>,
    Sherm Pendley <> wrote:

    > "rf" <> writes:
    >
    > > JK is a fucking pedantic idiot and this thread simply
    > > proves it.

    >
    > I wouldn't say he's an idiot. Quite the opposite in fact - I think he's
    > smarter than most of the people here, including me. He is, however,
    > very badly lacking in people skills.


    You should talk, Mr Diplomacy Who Began All This! <g>

    --
    dorayme
     
    dorayme, Dec 22, 2009
    #19
  20. Sorry for my unclear and confusing posting.
    Yes, of course, a normal HTML table is not sortable by clicking on its
    header row and in that case I wouldn't care about the "selection
    feature".
    I'm using javascript to make the HTML table sortable. Therefore you
    can click on the header row to sort the columns.

    The practice shows that if you click on the header row to sort the
    columns to often a letter or even the whole text in the header row of
    the columns gets selected.
    Now I'm trying to find a way to disable this "selection feature".

    I think that Andy's suggestion could be the solution for my problem:
    You could place an absolute positioned div within a relative
    positioned div (which contains your heading) then use a 100% height by
    100% width blank image in the absolute div as your link (onclick)
    anchor.

    But it's not working so far. Any additional help is very welcome.
    Stefan
     
    Stefan Mueller, Dec 22, 2009
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lee Harvey
    Replies:
    2
    Views:
    4,950
    Emmanuel Gleizer
    Jun 29, 2011
  2. Replies:
    1
    Views:
    702
    Grant Wagner
    Dec 6, 2004
  3. Replies:
    2
    Views:
    4,035
    Tim Williams
    Dec 7, 2004
  4. BTHOMASinOHIO
    Replies:
    2
    Views:
    176
  5. palmiere
    Replies:
    1
    Views:
    465
    Erwin Moller
    Feb 9, 2004
Loading...

Share This Page