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

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

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -