zudolab jqAutoHideGuideText

About

jqAutoHideGuideText implements guide text to input[@type=text] and textarea.
works as jQuery plugin.

Author

Takeshi Takatsudo [website] [mail]

How to use

Simple usage

  1. Load jQuery and jqAutoHideGuideText.js
  2. Specify the target input(or textarea) element and the guide text like following.

    new AutoHideGuideText({
        input: "#query",
        guideText: "search word"
    });
    <input type="text" size="30" id="query" />

    This will set the specified guide text while the input element is not focused.
    Class attribute "guideMode" will be added while the input element is not focused.

Avoid submitting feature

You can specify the form element to avoid submitting while the element was in the guideMode.
This can avoid the user to submit the guide text value.
If the user didnot input anything in the form and push the submit button, http://example.com will receive query="search word" without this.

new AutoHideGuideText({
    input: "#query",
    form: "#searchForm",
    guideText: "search word"
});
<form method="get" action="http://example.com/" id="searchForm">
    <input type="text" size="30" name="query" id="query" />
    <input type="submit" value="search" />
</form>

Target browsers

  • Internet Explorer 6+
  • Firefox 2+
  • Safari 2.0.4+
  • Opera 9.6+

Please tell me if you found that this script does not work on your browser though I cannnot support old browsers. takazudo@gmail.com

Depend on

I checked this script with jQuery version1.2.6.
Please tell me if this script doesn't work in newer version of jQuery.

License

You can use this script for your personal or commercial use if you don't erase the credit in the script.

ChangeLog

date version notes
2009/1/5 1 first release.

FAQ

No question is asked yet.
Please report me if you found some bugs. takazudo@gmail.com