MyBB Community Forums

Full Version: make a "hidden text" in form?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I would like to let users know before they click inside the "Username/Password" in the form what the box is.

I want to put a hidden text that say "Username" to where when you click inside that username box, it will disappear and users type their username in. The same for password.

Is this possible?

Location: http://gyazo.com/c1fcfd41e26347d529485797048e83e6
Website: http://www.Vizzy.VisualizeEdits.com/
simple method is to use javascript functions onblur & onfocus or placeholder (see replies here)
(2013-07-12, 08:41 AM).m. Wrote: [ -> ]simple method is to use javascript functions onblur & onfocus or placeholder (see replies here)

Okay, I found this and do I place this code in my headerinclude?
<input 
    type="text" 
    value="Name:"
    name="visitors_name" 
    onblur="if(value=='') value = 'Name:'" 
    onfocus="if(value=='Name:') value = ''"
 />

or

<search_bar input 
    type="text" 
    value="Name:"
    name="visitors_name" 
    onblur="if(value=='') value = 'Name:'" 
    onfocus="if(value=='Name:') value = ''"
 />

I want it to take effect on this in the search bar.
http://gyazo.com/4ac720be6e1f21f4219b867f59bf321a
http://gyazo.com/165629d9e49dfedd31e89ba6d90044e3

and make my text say "Search..."
for the search box, you can modify below (in the form code)
<input type="text" value="" name="keywords" class="textboxse">

with the code like below
<input type="text" value="Search .." onblur="if(value=='') value = 'Search ..'"   onfocus="if(value=='Search ..') value = ''" />
Just use this:

<input type="text" placeholder="Username">
(2013-07-12, 07:41 PM).m. Wrote: [ -> ]for the search box, you can modify below (in the form code)
<input type="text" value="" name="keywords" class="textboxse">

with the code like below
<input type="text" value="Search .." onblur="if(value=='') value = 'Search ..'"   onfocus="if(value=='Search ..') value = ''" />

I put the password as this code:
<p><input type="password" value="Search..." onblur="if(value=='') value = 'Search...'"   onfocus="if(value=='Search...') value = ''" class="textbox" name="password" size="25" style="width: 200px;" value="{$password}" /></p>

But when I look at it, it showing up as dot instead of text.

I will try the placeholder and see @Jambuster
type=password is supposed to show dots, its function is to hide the text as you type, so no one behind you can see your password as you type it in.
(2013-07-12, 08:11 PM)Jambuster Wrote: [ -> ]type=password is supposed to show dots, its function is to hide the text as you type, so no one behind you can see your password as you type it in.

Yeah I know, but would like it to show "Password" and then when you click on the box it will turn blank and you type your password which will be in dots. I think I have an idea like this maybe?
Edit delete this lol
(2013-07-12, 08:23 PM)Jambuster Wrote: [ -> ]Edit delete this lol

lol I know it's weird but I'm just saying as an example. :/
Pages: 1 2