Click here to Skip to main content
13,559,423 members
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

10.4K views
Posted 18 Dec 2009
Licenced CPOL

onfocus , onblur :: input box / textbox

, 11 Apr 2011
Rate this:
Please Sign up or sign in to vote.
for asp.net<asp:TextBox ID="txtUserName" Text ='Enter User Name' onFocus="if (this.value == 'Enter User Name' || this.value == 'User Name Not found' || this.value == 'Password Not found' || ...
for asp.net

<asp:TextBox ID="txtUserName" 
             Text ='Enter User Name'  
             onFocus="if (this.value == 'Enter User Name'     || 
                          this.value == 'User Name Not found' || 
                          this.value == 'Password Not found'  || 
                          this.value == 'User Name and Password Mismatch')
                      {
                          this.value           = '';
                          this.style.color     = 'Black';
                          this.style.fontStyle = 'normal';
                      }" 
             onBlur="if (this.value == '') 
                     {
                         this.style.color     = 'gray';
                         this.value           = 'Enter User Name';
                         this.style.fontStyle = 'italic';
                     }" 
             AutoCompleteType="Disabled"  
             class="flatboxlogin" 
             runat="server" 
             BackColor="Transparent" 
             BorderColor="Transparent" 
             Font-Italic ="true"  
             ForeColor="gray">


EDIT ===========

Made your code snippet more readable.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

piapeti
Software Developer
India India
This member doesn't quite have enough reputation to be able to display their biography and homepage.

You may also be interested in...

Comments and Discussions

 
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04-2016 | 2.8.180515.1 | Last Updated 11 Apr 2011
Article Copyright 2009 by piapeti
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid