Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Trouble getting intitial text of input box to disappear upon clicking
Old 11-13-2008, 10:52 PM Trouble getting intitial text of input box to disappear upon clicking
Junior Talker

Posts: 4
Trades: 0
Hi all.

I just want the text in my search bar to disappear when the user clicks inside of it.

Here is my code:

<input type="text" title="Search" onfocus="(this.value=='test'){this.value='';}" onblur="if(this.value==''){this.value='test';}" value="test"><input value="Find" type="submit">

I can make the onfocus/onblur parameters work with a form, but it doesn't work with this and I don't know why. Syntax? I dunno. Can anyone help?

Thanks.
TastyMonolith is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-14-2008, 12:21 AM Re: Trouble getting intitial text of input box to disappear upon clicking
Junior Talker

Posts: 4
Trades: 0
Nevermind...

<input type="text" value="test" onfocus="if(this.value=='test'){this.value='';}" onblur="if(this.value==''){this.value='test';}"/><input value="Find" type="submit">

(left out the "if" from onfocus)

Last edited by TastyMonolith; 11-14-2008 at 12:38 AM..
TastyMonolith is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Trouble getting intitial text of input box to disappear upon clicking
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.74404 seconds with 12 queries