jqAutoHideGuideText implements guide text to input[@type=text] and textarea.
works as jQuery plugin.
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.
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>
Please tell me if you found that this script does not work on your browser though I cannnot support old browsers. takazudo@gmail.com
I checked this script with jQuery version1.2.6.
Please tell me if this script doesn't work in newer version of jQuery.
You can use this script for your personal or commercial use if you don't erase the credit in the script.
| date | version | notes |
|---|---|---|
| 2009/1/5 | 1 | first release. |
No question is asked yet.
Please report me if you found some bugs. takazudo@gmail.com