The text of this article is not in this database — only its details are. Read it on the old site: Watermark Effect Using jQuery
6 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
The text of this article is not in this database — only its details are. Read it on the old site: Watermark Effect Using jQuery
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
Sagar Pandurang KapPosted Nov 29, 2017, 4:21 AM
Then just call this function on onblur and onfocus event of textboxes.
Sagar Pandurang KapPosted Nov 29, 2017, 4:20 AM
For Normal Textboxes Easy Way is as Follows : function WaterMark(objtxt, event) { var defaultText = "Enter Username Here"; var defaultpwdText = "Enter Password Here"; // Condition to check textbox length and event type if (objtxt.id == "txtusrname" || objtxt.id == "txtpasswd") { if (objtxt.value.length == 0 & event.type == "blur") { //if condition true then setting text color and default text in textbox if (objtxt.id == "txtusrname") { objtxt.style.color = "Gray"; objtxt.value = defaultText; } if (objtxt.id == "txtpasswd") { objtxt.style.color = "Gray"; objtxt.value = defaultpwdText; } } } // Condition to check textbox value and event type if ((objtxt.value == defaultText || objtxt.value == defaultpwdText) & event.type == "focus") { if (objtxt.id == "txtusrname") { objtxt.style.color = "black"; objtxt.value = ""; } if (objtxt.id == "txtpasswd") { objtxt.value = ""; } } }
Sagar Pandurang KapPosted Nov 29, 2017, 4:18 AM
I have same question rushal
Rushal AroraPosted Jun 28, 2012, 6:34 AM
For Password Field, Textmode should be Password rather than single line. Please correct it and give me the correct version.
Sivaraman DhamodaranPosted Nov 22, 2011, 5:08 AM
You had written a useful article. One more use of water mark is to avoid unauthorized usage of something. An image having a water mark in it (Or) even your sample having more controls having single water mark all over the control in diagonal way etc.