views:

26

answers:

3

Like... I want text fields to say stuff like..

password....

and then when the user clicks in them, the text goes away, and allows them to type.

A: 

HTML5 Supports this. In the meantime, there are javascript solutions.

ghoppe
A: 

A very simple solution is to set the text staticly to the input box and add a javascript function to the OnFocus() event.

In the function, do something like

$("textbox").val("")

treefrog
I have to add though that if you're doing passwords, the text will show up as ****, even before the click. The logic remains the same but you'll need to find something that displays actual text in password textboxes.
treefrog
A: 

in your view template, set a default value

f.text_field :password, :value => "password"

in your javascript (assuming jquery here)

$(document).ready(function() {
  //add a handler to remove the text
} );
Jed Schneider