Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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])