...

View Full Version : check if textInput.focus == true?



Kirl
10-16-2006, 04:57 PM
How can I check if the focus is on a particular textfield?

I want to make a statement like below (though preferably a working one :) ), the code should only be executed when the focus is not the field:


if ( myForm.textInput.focus != true )
{
task
}

_Aerospace_Eng_
10-16-2006, 05:09 PM
Just do

myForm.textInput.onfocus = function()
{
task
}
or put onfocus="doSomething()" in the actual input box.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum