Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2011
    Location
    Saginaw MI
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Help " Input Box Text Disappear "

    I've been trying to find a good JavaScript code that I can use to make the text in my User Name and Password Input Boxes disappear. Does anyone know where I can get a good code for that?

    Thank you...

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,925
    Thanks
    56
    Thanked 548 Times in 545 Posts


    disappear?

    you mean like the default text?

    maybe this:

    Code:
    <input type='text' value="Some default text" onfocus="searchfield_focus(this)"/>
    <script type="text/javascript">
    function searchfield_focus(obj)
    {
    obj.style.color=""
    obj.style.fontStyle=""
    if (obj.value=="Some default text")
    	{
    	obj.value=""
    	}
    }
    
    </script>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •