PDA

View Full Version : help with clearing text with onSetFocus


timateo
12-29-2005, 07:23 PM
I am trying to clear error messaging from a text box using onSetFocus. It writes to search_txt fine but won't clear.


search_btn.onRelease = function() {
if (searchString == null) {
search_txt.text= "Please enter a valid search term.";
} else {
getURL("http://companyURL/search/results.cfm"+"?search="+searchString, "_self", "POST");
}
}
search_btn.onSetFocus = function() {
search_txt.text = "";
}


Thanks in advance for your help.

J_Miller
12-30-2005, 03:34 AM
Not 100% sure on this without testing it, but i think the button would still have focus after the onRelease.....so unless you selected something different and came back to the button it will not fire the onSetFocus.

In this case i usually fire an interval that shows some text for a few seconds then clears the text and the interval leaving everything in its original state

Hope that helps!

timateo
12-30-2005, 01:43 PM
that helps very much, thanks Jason.