Wednesday, March 21, 2007

Textbox highlight all using onclick and this.select()

Thanks to Carlos's Teaching.

How to select all and highlight the pre-typed text in the TextBox for better user experiences?



By using the code in Code Behind:

this.tbSeach.Attribute.Add("onclick","this.select()");



Design view:

ID="tbSearch" Text="Input keywords..." runat="server" ForeColor="DimGray" / />







powered by performancing firefox

No comments: