[Javascript] Disabling focus and selection on static text objects

Chris Tifer christ at saeweb.com
Tue Mar 25 09:36:38 CST 2003


This works in IE, but didn't get it working in NN:

<script language="javascript">
<!--
 document.onselectstart = cancelSelect

 function cancelSelect(){
  return false
 }
//-->
</script>

I'm sure it has something to do with passing the event to the function
as I know NN handles things differently that way.

Chris Tifer

----- Original Message -----
From: "David T. Lovering" <dlovering at gazos.com>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Tuesday, March 25, 2003 10:12 AM
Subject: Re: [Javascript] Disabling focus and selection on static text
objects


>
> Ideally, something that could tame the whole page at one go would be the
best general solution, but it would be helpful to know how to do it in
individual cases as well I should imagine.
>
> -- Dave Lovering
>
> Chris Tifer wrote:
> >
> > Would you like this to cover the whole page, or specially defined
elements?
> > I'm sure we're going to have to look into onSelectStart (or something
like
> > tha t
> > if my memory suits me well this morning).
> >
> > Chris Tifer
> >
> > ----- Original Message -----
> > From: "David T. Lovering" <dlovering at gazos.com>
> > To: <javascript at LaTech.edu>
> > Sent: Tuesday, March 25, 2003 10:01 AM
> > Subject: [Javascript] Disabling focus and selection on static text
objects
> >
> > >
> > > I wonder -- does anybody know how to suppress the selection and/or
focus
> > on screen widgets (like text labels in front of inputs, etc.)?  I've
tried
> > the "usual" methods of defining onFocus='this.blur()' for everything
which
> > is purely window dressing, but
> > > it makes no difference.  Same deal with 'readonly' and 'disable'.
> > >
> > > Back in the early Precambrian, Netscape had a directive (which if
memory
> > serves was 'noselect') which you could tack into the contents of any
> > tag-field descriptor to permanently suppress focus from its widget.
> > Obviously, this doesn't exist anymore, but
> > > I'd like something that resembles it functionally.
> > >
> > > This problem manifests whenever someone drags the mouse too quickly
over
> > the active page and half the screen gets 'selected', including things
which
> > should never get the focus at all.  Also, I'd like to disable the means
for
> > punks to double-click or
> > > drag-select labels just to mess up my head.
> > >
> > > -- Dave Lovering
> > > _______________________________________________
> > > Javascript mailing list
> > > Javascript at LaTech.edu
> > > https://lists.LaTech.edu/mailman/listinfo/javascript
> >
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > https://lists.LaTech.edu/mailman/listinfo/javascript
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list