cdzhoubin / jquery-watermark

Automatically exported from code.google.com/p/jquery-watermark
0 stars 0 forks source link

Feature Request - custom watermark using an attribute #75

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
hi there,

First of all - thanks for an awesome plugin! This should did save me a lot of 
time!

One thing I think is missing is the option to set the watermark label on an 
input level. If I could do that then I could set all inputs with the same CSS 
class ("watermark") and then to activate the plugin using the watermark() 
method and I wouldn't need to add the text parameter.

The watermark text would be extracted from the input as the plugin cycles 
through the inputs it picked up:

<input type="text" name="inp1" data-watermark="Watermark Label 1" />
<input type="text" name="inp2" data-watermark="Watermark Label 2" />

Maybe I missed it and I can be done in current version? :)

Anyway, I hope this makes sense!
David.

Original issue reported on code.google.com by davi...@gmail.com on 28 Nov 2011 at 11:57

GoogleCodeExporter commented 9 years ago
exactly the feature I was looking for!

something like:

<input type="text" name="CustNumbr" class="watermarked" watermark="Enter 
Customer Number" />

and then....

     $('.watermarked').watermark(this.attr("watermark"));

or maybe....

     $('.watermarked').watermark(function(){
         return this.attr("watermark");
      });

Original comment by jdzakar...@gmail.com on 12 Apr 2012 at 9:58

GoogleCodeExporter commented 9 years ago
Heya! The idea I propose doesn't require JS code, only the attribute. The 
plugin can do the rest. Adding JS code defeats the whole purpose I think.

Anyway, so far it doesn't seem to be a priority.

Cheers!
D

Original comment by davi...@gmail.com on 12 Apr 2012 at 11:56

GoogleCodeExporter commented 9 years ago
David, 

I did some searching around and found a different plug-in that does what I 
think you are looking for...

https://github.com/danielstocks/jQuery-Placeholder

This enables the html5 "placeholder" (i.e. watermark) attribute for old 
browsers.

bests,

jz

Original comment by jdzakar...@gmail.com on 13 Apr 2012 at 10:23

GoogleCodeExporter commented 9 years ago
Thanks for that mate!! :)

Original comment by davi...@gmail.com on 13 Apr 2012 at 10:31

GoogleCodeExporter commented 9 years ago
This issue is fixed in the latest release (3.2.0), with the addition of the 
textAttr option.

Original comment by t...@speednet.biz on 16 Aug 2014 at 4:53