Hintify: A small jQuery Plugin
13 Jul 2010
Hintify is a simple jQuery plugin that makes it easy to add helper texts inside of form inputs. When the user clicks into the field the text disappears and allows the user to type whatever he or she wants. If nothing is typed and the user leaves the field by clicking somewhere else the hint text reappears.
- On focus: Hint disappears and the "hint" class is removed.
- Leave and it comes back.
- Type and the text is black instead of gray.
- Leave the field and what you typed stays there.
- Delete it all and leave then the hint text comes back.
- Submit the form and the hints are cleared out first.
Once you've got the scripts included and the styles to your liking it is super easy to add hints to any text inputs. The biggest limitation I've found with this approach is that it won't work on password fields.
Code for Demo