Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Watermark and using .Val()

I have a problem in that I am using a simple watermark plugin such that it works

jQuery('#selector').Watermark('Watermark text here ...');

The problem is - when I try and use something like

if (jQuery('#selector').val() != "") { //do stuff }

The statement is True because of the watermark. Is there anyway I can somehow "ignore" this watermark value for my If statement ?

Thanks

like image 647
Tom Avatar asked Dec 16 '25 19:12

Tom


1 Answers

if (jQuery('#selector').val() != "" && jQuery('#selector').val() != "'Watermark text here ...'") { //do stuff }

This only assumes that the watermark text is static across examples. If not then you may need a collection of watermark texts?

like image 86
dredful Avatar answered Dec 19 '25 13:12

dredful



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!