vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=253)
-   -   Pre-populated text in header search box (https://vborg.vbsupport.ru/showthread.php?t=311949)

409industries 06-06-2014 08:55 PM

Pre-populated text in header search box
 
This has to be the most basic edit to a forum ever, but i've been looking all over and can't seem to find the answer!

On the "main" search box on a forum index page in the header, how to you have it pre-populate with some text (for example "Search xyx.com forums") and have it disappear when a user starts typing?

Is there template that can be edited with some code to do this?

John Lester 06-08-2014 01:48 AM

Not sure if it's the same template for 4.2.x but it's a simple edit.

http://www.vbulletin.com/forum/forum...66#post3573666

The edit works in FireFox, can't say if it works in other browsers since I don't have my test site up any longer.

tbworld 06-08-2014 02:42 AM

Should work in all current browser today including IE10+. Nice post @John_Lester forgot all about the new (3 years old) placeholder element. I have always done this effect in JavaScript. :)

409industries 06-09-2014 09:31 PM

Made the code edits (I had to poke around a bit as my theme had this in the "header" template). Turns out that the compatiblity seems to be as it was before. Works great in Firefox (29.0.1) and Chrome (35.0.1916.114 m), but Internet Explorer (10.0.9200.16899) does not display the placeholder text.

Not a deal breaker by any means. Thank you John_Lester ad tbworld for replying. This is exactly what I was looking for and i'm glad it didn't require a plugin to get it to work.


All times are GMT. The time now is 12:58 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01048 seconds
  • Memory Usage 1,713KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete