# Default text in search text field

**URL:** <https://www.ruby-forum.com/t/default-text-in-search-text-field/190942>\
**Category:** Ferret\
**Created:** [July 1, 2010, 11:10am UTC](https://www.ruby-forum.com/t/default-text-in-search-text-field/190942 "2010-07-01T11:10:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![makotogim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@makotogim](https://www.ruby-forum.com/u/makotogim)\
**Post date:** [July 1, 2010, 11:10am UTC](https://www.ruby-forum.com/t/default-text-in-search-text-field/190942/1 "2010-07-01T11:10:30Z")

</div>

Hello,

I am trying to figure out how I can introduce a default text in my  
searchbox that is removed automatically when the user tries to write  
something.

Is this possible to do it with some kind of ferret command? The only way  
I can find I can do it is with some javascript code.

Thanks in advance

Makoto

---

<div class="post-metadata">

**Author:** ![makotogim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@makotogim](https://www.ruby-forum.com/u/makotogim)\
**Post date:** [September 22, 2010, 9:05am UTC](https://www.ruby-forum.com/t/default-text-in-search-text-field/190942/2 "2010-09-22T09:05:05Z")

</div>

Makoto Gim wrote:

> Hello,
> 
> I am trying to figure out how I can introduce a default text in my  
> searchbox that is removed automatically when the user tries to write  
> something.
> 
> Is this possible to do it with some kind of ferret command? The only way  
> I can find I can do it is with some javascript code.
> 
> Thanks in advance
> 
> Makoto

Yes you have to use JS code to make it simpler and faster.

–  
Regards,

T.Veerasundaravel.

> **[Veerasundaravel's Ruby on Rails Weblog](https://veerasundaravel.wordpress.com)**
>
> Ruby on Rails Weblog for Ebooks, Ruby Tips, Rails Tips and more.

@veerasundaravel

---

<div class="post-metadata">

**Author:** ![makotogim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9e8a1a/32.png) [@makotogim](https://www.ruby-forum.com/u/makotogim)\
**Post date:** [September 24, 2010, 12:07am UTC](https://www.ruby-forum.com/t/default-text-in-search-text-field/190942/3 "2010-09-24T00:07:41Z")

</div>

Hello Veera,

Thanks a lot, it worked perfectly!!!

regards

@makotogim

Veera S. wrote:

> Makoto Gim wrote:
> 
> > Hello,
> > 
> > I am trying to figure out how I can introduce a default text in my  
> > searchbox that is removed automatically when the user tries to write  
> > something.
> > 
> > Is this possible to do it with some kind of ferret command? The only way  
> > I can find I can do it is with some javascript code.
> > 
> > Thanks in advance
> > 
> > Makoto
> 
> Yes you have to use JS code to make it simpler and faster.
> 
> –  
> Regards,
> 
> T.Veerasundaravel.  
> [Veerasundaravel's Ruby on Rails Weblog | Ruby on Rails Weblog for Ebooks, Ruby Tips, Rails Tips and more.](http://tinyurl.com/25vma7h)  
> @veerasundaravel
