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 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need to erase the default value of field on focus

    well, I had set the value of the text field to 'if other specify but not able to erase the value to ' ' using onFocus="this.value=''".I request members to help me with a answer.

    Thanking you in advance

  • #2
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What's the problem?
    *this message will self destruct in n-seconds*

  • #3
    New Coder
    Join Date
    Aug 2004
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    I think this is what you want...
    Code:
    <input type="text" value="Have fun" onfocus='if(this.value==this.defaultValue) this.value="";'>
    Next time please be specific with your problem along with ur code...

    Have fun
    Afru.


  •  

    Posting Permissions

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