Makes an input field clear and unclear itself with javascript
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
README.rdoc
self_clearing_input.js
test.html

README.rdoc

About

Sets up a simple self-clearing input field. When you click in a field the default value is cleared and when you blur the field it reverts back if the user doesn't enter any data.

Requires

  • Prototype 1.6.*

Example

// In your javascript file somewhere
document.observe("dom:loaded", function()  
{  
    new SelfClearingInput('ID_OF_INPUT_BOX');  
});