Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if focus = false then do this... 1

Status
Not open for further replies.

rubychyld

Programmer
Mar 22, 2001
76
US
this function fires on mouseout of an input box. If the input box has focus, I don't want this to happen. But, alas, it ignores my if statement. What can I do? Please help.

function low_lite()
{
if (!this.focus) //or even if(this.focus==false)
{
element.style.color="#000066"
element.style.backgroundColor="#FFFFFF"
element.style.borderWidth="1px 1px 1px 1px"
element.style.borderStyle="solid"
element.style.borderColor="#666699"
}
} Catch the vigorous horse of your mind!
 
A sugestion:
change function low_lite() to function low_lite(object) and this
if (!this.focus) to this if (!object.focus)
and do something like this onmouseover="javascript:low_lite(this)" My codes look like something a kid wrote
I have absolutely no idea what I am talking about
Somehow I still manage to make it work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top