corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Input text fields within HTML


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Input text fields within HTML
liamC
Member

Registered: 28th Feb 04
User status: Offline
8th Jun 07 at 13:41   View User's Profile U2U Member Reply With Quote

I have a text field which says '--Enter your Email Address--' in the text field when the page is first loaded.

When the user clicks in the box I want the '--Enter your Email Address--' text to disappear.

At the moment it just stays in and I have to delete it before typing the email address.

Does anyone know how to make the text disappear once it is clicked on?
James
Member

Registered: 1st Jun 02
Location: Surrey
User status: Offline
8th Jun 07 at 14:06   View User's Profile U2U Member Reply With Quote

You need to use Javascript.

http://www.yourhtmlsource.com/forms/clearingdefaulttext.html
liamC
Member

Registered: 28th Feb 04
User status: Offline
8th Jun 07 at 14:28   View User's Profile U2U Member Reply With Quote

Cheers fella - looking into it now
Dom
Member

Registered: 13th Sep 03
User status: Offline
8th Jun 07 at 16:05   View User's Profile U2U Member Reply With Quote

code:
<input type="text" id="tx" name="tx" value="click" onclick="this.value='';"/>


should work
liamC
Member

Registered: 28th Feb 04
User status: Offline
8th Jun 07 at 19:55   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Dom
code:
<input type="text" id="tx" name="tx" value="click" onclick="this.value='';"/>


should work


Also spot on and works for my text area where the javascript one doesn't. Cheers!

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
php question - need more help :( Dom Geek Day 10 819
22nd Jan 05 at 00:02
by Dom
 
Sweet charged civic!!!!!!1 antscorsa General Chat 11 237
24th Jan 05 at 06:34
by Wolfy
 
Input on a website please, web designers especially :D drunkenfool Geek Day 56 3017
25th Nov 06 at 19:08
by aPk
 
Need to create HTML for this........ FINISHED PG3 dave17 Geek Day 72 2303
11th Jan 07 at 23:31
by drax
 
MYSQL Problem(s) liamC Geek Day 23 1042
14th Jan 07 at 14:21
by Ian
 

Corsa Sport » Message Board » Off Day » Geek Day » Input text fields within HTML 29 database queries in 0.0090909 seconds