TWEagle / jquery-watermark

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

Allow watermark to be set by title attribute? #55

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I would like to know if it is supported or not and possibly a feature request, 
but all of my form elements have title attributes.  It would be great if the 
watermark could be generated from that value vs. being required to add a 
watermark for each individual element.  I may be missing something here, but I 
am not able to get this to work?

Original issue reported on code.google.com by mrwilli...@gmail.com on 25 Mar 2011 at 1:53

GoogleCodeExporter commented 9 years ago
Until a function option is added for the first argument (instead of just a 
string), use the following simple method of setting watermarks via title 
attribute:

$( "input:text" ).each( function () {
   $( this ).watermark( this.title );
});

(Of course, you would change the selector to whatever works in your case.)

I don't plan on adding any particular "automatic" watermark via particular 
attributes (like title or data-watermark, or anything like that).  That would 
force everyone to do their watermarks in a way they may not agree with, or that 
does not fit into their site design/architecture.  For example, title may be 
used for a different purpose on someone else's Web site.

Original comment by t...@speednet.biz on 25 Mar 2011 at 2:13

GoogleCodeExporter commented 9 years ago
Thank you for the speedy response.  Much appreciated.  This is an excellent 
plugin!

Original comment by mrwilli...@gmail.com on 25 Mar 2011 at 2:15