<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2726.2500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Courier New">Just to wrap up this discussion, I polished
Bekim's code to "full workability" and am including it below. Rather than
prescribing naming conventions for active fields (who wants all their active
inputs to be called "field-XXX"?), I modified the routine to work off the
nodeName and type, thusly:</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"> function handleSelectStart(evt)
{</FONT></DIV>
<DIV><FONT face="Courier New"> evt = (evt) ? evt :
(window.event) ? window.event : "";</FONT></DIV>
<DIV><FONT face="Courier New"> if (evt) {</FONT></DIV>
<DIV><FONT face="Courier New"> var inputType =
evt.srcElement.type;</FONT></DIV>
<DIV><FONT face="Courier New"> var inputNodeName =
evt.srcElement.nodeName;</FONT></DIV>
<DIV><FONT face="Courier New"> if (inputNodeName
== "INPUT") {</FONT></DIV>
<DIV><FONT face="Courier New"> return
true;</FONT></DIV>
<DIV><FONT face="Courier New"> }</FONT></DIV>
<DIV><FONT face="Courier New"> if (inputNodeName
== "TEXTAREA") {</FONT></DIV>
<DIV><FONT face="Courier New"> return
true;</FONT></DIV>
<DIV><FONT face="Courier New"> }</FONT></DIV>
<DIV><FONT face="Courier New"> if (inputType ==
"undefined") {</FONT></DIV>
<DIV><FONT face="Courier New"> return
false;</FONT></DIV>
<DIV><FONT face="Courier New"> }</FONT></DIV>
<DIV><FONT face="Courier New"> return
false;</FONT></DIV>
<DIV><FONT face="Courier New"> }</FONT></DIV>
<DIV><FONT face="Courier New"> } // handleSelectStart()</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"> document.onselectstart =
handleSelectStart;</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">Note -- certain older versions of Netscape may
have issues with the handler name, as they generally prefer all lower-case for
such things.</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">Anyway, this method worked like a champ on the
four or five browser types I had time to check. Thanks Bekim!</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">Now if only someone could explain to me why the
various major browser-writing bodies didn't build this into their engines at the
get-go, I'd be a happy man.</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">-- Dave Lovering</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial"><FONT face="Courier New" size=3>----- Original
Message ----- </FONT></DIV>
<DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><FONT
size=3><FONT face="Courier New"><B>From:</B> </FONT></FONT><A
title=trojani2000@hotmail.com href="mailto:trojani2000@hotmail.com"><FONT
face="Courier New" size=3>BEKIM BACAJ</FONT></A><FONT face="Courier New"
size=3> </FONT></DIV>
<DIV style="FONT: 10pt arial"><FONT size=3><FONT face="Courier New"><B>To:</B>
</FONT></FONT><A title=javascript@LaTech.edu
href="mailto:javascript@LaTech.edu"><FONT face="Courier New"
size=3>javascript@LaTech.edu</FONT></A><FONT face="Courier New" size=3>
</FONT></DIV>
<DIV style="FONT: 10pt arial"><FONT size=3><FONT
face="Courier New"><B>Sent:</B> Wednesday, July 16, 2003 11:12
AM</FONT></FONT></DIV>
<DIV style="FONT: 10pt arial"><FONT size=3><FONT
face="Courier New"><B>Subject:</B> Re: [Javascript] peculiarity of
onselectstart/third</FONT></FONT></DIV>
<DIV><FONT face="Courier New"><BR></FONT></DIV>
<DIV>
<DIV>
<DIV><FONT face="Courier New"></FONT></DIV><FONT face="Courier New">Well, you
owe me this one! </FONT></DIV>
<DIV><FONT face="Courier New"></FONT></DIV>
<DIV><FONT face="Courier New"></FONT></DIV><FONT face="Courier New">the
onselectstart turned false disables all the content from being </FONT>
<DIV></DIV><FONT face="Courier New">selected, no matter what you do after this
will not help so wei will </FONT>
<DIV></DIV><FONT face="Courier New">filter unwanted items like this: </FONT>
<DIV></DIV>
<DIV><FONT face="Courier New"></FONT></DIV>
<DIV><FONT face="Courier New"></FONT></DIV>
<DIV><FONT face="Courier New"></FONT></DIV>
<DIV><FONT face="Courier New"></FONT></DIV>
<SCRIPT language=JavaScript>
</DIV>> <!--
</DIV>>
</DIV>>function filterSelectability(){
</DIV>>                var inptName=event.srcElement.name;
</DIV>>//Headache! - suppressing error for "undefined" elements
</DIV>>        if (typeof(inptName) == "undefined"){return false}
</DIV>>//making this compare 'true' for all elements named 'field' no
</DIV>>matter the number- helpfull enough!
</DIV>>                var fld=inptName.substring(0,5);
</DIV>>        if(fld=='field'){return true}
</DIV>>                 else{return false}
</DIV>>                }
</DIV>> document.onselectstart = filterSelectability;
</DIV>> // -->
</DIV>> </SCRIPT>
<DIV><FONT face="Courier New"></FONT></DIV>
<DIV><FONT face="Courier New"></FONT></DIV>
<DIV><FONT face="Courier New"></FONT></DIV>
<DIV><FONT face="Courier New"></FONT></DIV>
<P><FONT face="Courier New"><HTML><BR>
<HEAD><BR> <TITLE> Trojani
</TITLE><BR> <script
language='JavaScript'><BR> <!--</FONT></P>
<P><FONT face="Courier New">function filterSelectability(){<BR> var
inptName=event.srcElement.name;<BR></FONT><FONT
face="Courier New"><EM>//Headache! - suppressing error for "undefined"
elements <BR></EM> if (typeof(inptName) == "undefined"){return
false}<BR> var
fld=inptName.substring(0,5);<BR> if(fld=='field'){return
true}<BR> else{return
false}<BR> }<BR>
document.onselectstart =
filterSelectability;<BR> //
--><BR> </script><BR>
</head><BR> <body></FONT></P>
<P><FONT face="Courier New"> <form
name='myBogusForm'
action='javascript:void(null)'><BR>
<center></FONT></P>
<P><FONT
face="Courier New">
<input name='field1' type='text' value='' size=30
><br><BR>
<input name='field2' type='text' value='' size=30 ><br></FONT></P>
<P><FONT face="Courier New">
</center><BR> </form></FONT></P>
<P><FONT face="Courier New">
</body><BR></html><BR> </FONT></P><FONT
face="Courier New">Had some hard time with undefined items but it is solved
now, </FONT>
<DIV></DIV><FONT face="Courier New">Cheers! </FONT>
<DIV></DIV>
<DIV><FONT face="Courier New"></FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV></DIV><BR clear=all><FONT
face="Courier New">
<HR>
Protect your PC - </FONT><A href="http://g.msn.com/8HMHEN/2755??PS="><FONT
face="Courier New">Click here</FONT></A><FONT face="Courier New"> for
McAfee.com VirusScan Online </FONT>
<P></P><FONT face="Courier New">
<HR>
</FONT>
<P></P><FONT
face="Courier New">_______________________________________________<BR>Javascript
mailing
list<BR>Javascript@LaTech.edu<BR>https://lists.LaTech.edu/mailman/listinfo/javascript<BR></FONT></BLOCKQUOTE></BODY></HTML>