Input fields can contain a suggestion text, which is removed on focus. If no text is entered when the field looses focus, the suggestion is set back into the input field
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.textile
jquery.suggestion-text.js

README.textile

About

This plugin was extracted for a project I was doing with a friend of mine. We needed a way to have a suggestion in an input field, to get a user started faster. This plugin DOES NOT use fancy CSS3 transformations or HTML5 for anything, ensuring your IE customer will be able to see the text as well.

Usage

To use this plugin, add it to you javascript include in the section of you HTML page.

To add the script to an input field, simply do the following:

$(‘input’).suggest();

Specify options to the plugin!

You can add your own help text, by passing in a hash object.

$(‘input’).suggest({ text: ‘This is my custom help text’ });

The the given text is displayed to help the user make a choice.

Default options

By default a css class is added to the field the plugin is initialized on, if either no input is given or the help text is shown.
The css class is called blurry.

Change the CSS class

You can change the CSS class by adding the following to your hash:

$(‘input’).suggest({ cssClass: ‘custom_css_class’ });