Question

I have some <input>s on my form, and I would like to watermark them with field labels. There are already myriad watermarking plugins, but best as I can tell they all clear the watermark when the <input> is focused, even if there's nothing entered.

What I'd like, ideally, is something that would continue to display until the user typed something in, focused or not.

Does anyone know of a plugin that does this already, or know of a code sample that might help guide my way?

Was it helpful?

Solution

This plugin will retain the watermark when the input is focused, although it will hide on any keypress (even Ctrl).

OTHER TIPS

I have created a flexible plugin for this purpose. it gets to state: focused and filled and you can define your own css to manage the style such as visibility, color and ... check the samples and full doc for jQuery Placeholder here

As another alternative, if you like one of the other plugins better for other reasons, it wouldn't be very difficult to alter the script so that watermark disappears on keyup rather than focus.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top