making text field text disapear

This is a discussion on "making text field text disapear" within the JavaScript Forum section. This forum, and the thread "making text field text disapear are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 17th, 2008, 13:04
SuperMember

SuperMember
Join Date: Mar 2007
Location: UK
Age: 21
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
making text field text disapear

Adding a contact form to my website, but I would like to put some text in the fields before hand, which auto deletes when you click in it. I can get the text in, but no way of it disappearing. I am using dreamweaver
Reply With Quote

  #2 (permalink)  
Old Jan 17th, 2008, 13:14
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: making text field text disapear

You'll need Javascript for that ... I'm assuming something in the the onfocus() event.

I'll move this over for you
Reply With Quote
  #3 (permalink)  
Old Jan 21st, 2008, 04:21
New Member
Join Date: Jan 2008
Location: China
Age: 24
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rrrrutdk
Re: making text field text disapear

Code: Select all
<input type="text" value="keywords" onfocus="disappear(this);" />
<script type="text/javascript">
 
</script>
Reply With Quote
  #4 (permalink)  
Old Jan 21st, 2008, 04:22
New Member
Join Date: Jan 2008
Location: China
Age: 24
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rrrrutdk
Re: making text field text disapear

Code: Select all
<input type="text" value="keywords" onfocus="disappear(this);" onblur="showKeywords(this)" />
<script type="text/javascript">
    function disappera(input) {
        if (input.value == "keywords") {
            input.value = "";
        }
    }
 
    function showKeywords(input) {
        if (input.value == "") {
            input.value = "keywords";
        }
    }
</script>

Last edited by rrrrutdk; Jan 21st, 2008 at 04:24.
Reply With Quote
  #5 (permalink)  
Old Feb 2nd, 2008, 07:49
Up'n'Coming Member
Join Date: Nov 2006
Location: Orem, Utah
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Re: making text field text disapear

http://www.alistapart.com/articles/m...oreaccessible/ is a great article on making compact forms. That might be what you want.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Value of text field to influence options for a select.. c_martini JavaScript Forum 1 Oct 19th, 2007 21:30
Validating Input Text field Mallik Flash & Multimedia Forum 1 Jun 11th, 2007 14:44
Non-text field Validation NewDesigner JavaScript Forum 6 Nov 24th, 2006 22:34
validate text field to db field jtesolin Classic ASP 1 Jul 18th, 2006 17:48
how to set the cursor to display on a particular text field tllcll JavaScript Forum 1 Aug 27th, 2005 06:21


All times are GMT. The time now is 01:07.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43