Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luckydev/helptext.js
a jQuery In-field label plugin
https://github.com/luckydev/helptext.js
Last synced: about 2 months ago
JSON representation
a jQuery In-field label plugin
- Host: GitHub
- URL: https://github.com/luckydev/helptext.js
- Owner: luckydev
- Created: 2011-10-15T11:24:31.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-11-03T16:31:50.000Z (almost 12 years ago)
- Last Synced: 2024-02-17T15:33:30.396Z (7 months ago)
- Language: JavaScript
- Homepage: http://luckydev.github.com/helptext.js
- Size: 133 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
Awesome Lists containing this project
README
:) this was my first jQuery plugin. I was pretty excited to see this coming out. Note that you can acheive the same help text thing in HTML 5 using placeholder attribute.
== helptext.js
helptext.js is a small jQuery plugin to label the form input elements inside their container itself. Look at http://luckydev.github.com/helptext.js for example. It can eliminate using labels in the forms.
=== How to use
helptext.js requires jQuery. It has been tested in jQuery 1.5.1. I'm sure it will work in almost all the versions. Also download and include helptext.js like below.
In the elements where you need help text, add an attribute `data-helptext` like:
Then call helptext() like:
$(document).ready(function(){
$("input[type=text], input[type=password], textarea").helptext();
})Use any selector for choosing the form elements. The above code is just an example.
=== Usage in Rails form helpers
<%= f.text_field :name, :"data-helptext" => "Give your name" %>
=== Author
Anand ([email protected])