Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Senior Member
    Join Date
    Mar 2004
    Posts
    1,518
    Member #
    5220
    OK. This is a hard effect to explain. You know when you see a login screen with 'username here' or something written in the 'username' field? Well, when you click that it goes away leaving the text field blank. Do you know what I mean? If you do, how can I achieve that effect. I'd imagine it would be with either CSS of Javascript. Any help?
    Rednerve
    Creative Freelance Design

  2.  

  3. #2
    Senior Member
    Join Date
    Dec 2003
    Posts
    1,274
    Member #
    4362
    It can be done with JS:
    Code:
    <input value="Username" onfocus="this.value='';" />
    This makes the input field blank when it gets focus (either with mouse or keyboard).

  4. #3
    Senior Member
    Join Date
    Mar 2004
    Posts
    1,518
    Member #
    5220
    That got it Cheers xarst
    Rednerve
    Creative Freelance Design

  5. #4
    Senior Member
    Join Date
    Dec 2003
    Posts
    1,274
    Member #
    4362
    This version checks if the value is the default, and if not, it doesn't delete it. And if it's blank, it will be filled again with the default.
    Code:
    <input value="Username" onfocus="if(this.value=='Username') this.value='';"  onblur="if(this.value=='') this.value='Username';" />

  6. #5
    Junior Member
    Join Date
    Oct 2006
    Posts
    1
    Member #
    14111
    Is it possible to take this one step further and have a password box's value show text like the above example. After the the user clicks inside the box, it first removes all text, then after the user types the results are encrypted.

  7. #6
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    No, as whatever is the value will be changed to *'s. So you cannot have text like "enter password here" as it will show up as "*******************"

  8. #7
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Oh, you probably could. Onfocus you could change the `type' of the box to `password' after clearing it.


Remove Ads

Posting Permissions

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

Search tags for this page

adobe default fields automatically deleted

,

auto delete text in textbox in html

,

how to clear automatic text in textbox

,

self delete text in boxes

Click on a term to search for related topics.
All times are GMT -6. The time now is 09:16 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com