The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Default Text In Search Box Area

View previous topic View next topic Go down

Solved Default Text In Search Box Area

Post by runawayhorses on February 13th 2013, 2:51 am

How do you write this code so the text will disappear once the user clicks on the input area, and also that it will reappear if the user clicks somewhere else? Right now the default text is "Search..." and it stays there until someone starts to write something into the search, they have to press and actual letter on there keyboard before the default text disappears. In short and the easiest way to explain this is by example, see the little search box on the right-hand side above the widgets area here just above the google+ twitter and facebook like count buttons on this forum? I want it to behave like that, when you click into the text area the "Search..." text disappears, and when you click out of it it reappears again.

Code:
    $(window).load(function() {
    document.getElementById('fa_search').getElementsByTagName('input')[0].setAttribute('placeholder','Search...');
    });

runawayhorses
Hyperactive

Male Posts : 2537
Reputation : 162
Language : English
Location : United States

http://runawayhorses.alldiscussion.net/

Back to top Go down

Solved Re: Default Text In Search Box Area

Post by runawayhorses on February 13th 2013, 2:58 am

Nope its not doing it, you can check it on my forum here:

Edit: I should mention its for the toolbar search box.

http://runawayhorses.alldiscussion.net/

runawayhorses
Hyperactive

Male Posts : 2537
Reputation : 162
Language : English
Location : United States

http://runawayhorses.alldiscussion.net/

Back to top Go down

Solved Re: Default Text In Search Box Area

Post by runawayhorses on February 13th 2013, 3:08 am

Excellent! Its working perfectly, thanks rideem. Smile

runawayhorses
Hyperactive

Male Posts : 2537
Reputation : 162
Language : English
Location : United States

http://runawayhorses.alldiscussion.net/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum