Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

How do you flush the search bar

I'd like to have a text ie: search written inside the search field and I would like this text to disapear when the search field gets the focus.

I tried this code but it does'nt work even with other events like click any ideas?


mySearch.addEventListener('focus', function(e)
{
    e.value=' ';

});
— asked March 12th 2010 by michel perrin
  • field
  • focus
  • search
0 Comments

1 Answer

  • I finally solved that by myself here's how the event argument is useless

    
    mySearch.addEventListener('focus', function(e)
    {
        mySearch.value=' ';
    
    });
    
    — answered March 13th 2010 by michel perrin
    permalink
    1 Comment
    • you could use e.source.value = '';

      The e.source value is useful ;-)

      — commented March 23rd 2011 by Daniel Tome
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.