javascript - Watermark text in asp.net? -


in web application using javascript water mark text in textboxes working fine textbox if textmode property set multiline water mark text not displaying there particular reason. code...

<textbox id="txtone" runat="server" tooltip="enter comments"  onblur="if(this.value=='') this.value='enter text,150 characters only';"  onfocus="if(this.value == 'enter text,150 characters only') this.value='';"   value="enter text,150 characters only"> </textbox> 

when textbox in multiline mode, it's rendered textarea instead of input element. textarea element doesn't use value attribute, code fails set initial value.

use text property of server control instead of value argument of client control:

<textbox id="txtone" runat="server" tooltip="enter comments" onblur="if(this.value=='') this.value='enter text,150 characters only';" onfocus="if(this.value == 'enter text,150 characters only') this.value='';" text="enter text,150 characters only"></textbox> 

Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -