Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to remove default text on textbox focus

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 861
    Comment on it

    Remove text from a textbox on focus and getting the text again after loosing focus

    Use below .aspx code to make a textbox remove the default text on focus and again get the default text if the user leaves the textbox blank.

    <asp:TextBox ID="txtSearchBox" value="Type here" runat="server"
       onblur="javascript: if(this.value==''){this.value='Type here';}"  
       onfocus="javascript: if(this.value == 'Type here'){this.value = '';}">
     </asp:TextBox>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: