Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 09-03-2007, 01:56 PM   #1 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,686

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Javascript help needed

I'm trying to make it so if I click in a text field, it removes the default value and I can type stuff in. I can do that easily enough. However, I need it so that if anything else is typed, it stays if I click on it.

Example:
A textbox with the default value of "Name". If I click inside it, "Name" is erased and I put "CrazeD". I then click again and "CrazeD" stays there, it doesn't get erased.

Can anyone help me?

I suck badly at Javascript. I've tried looking up tutorials and such for this and I can't find anything.

Any help would be awesome, thanks.
__________________

Need website help? PM me!
CrazeD is offline  
Old 09-04-2007, 05:15 PM   #2 (permalink)
 
Monster Techie

Join Date: May 2004

Location: Tucson, AZ, USA

Posts: 1,183

Vormund

Send a message via AIM to Vormund Send a message via MSN to Vormund Send a message via Yahoo to Vormund
Default Re: Javascript help needed

Of the billion ways to do it (give or take a few!), this is probably the most straight-forward way to do it:
Code:
onfocus="if (this.value=='Name') this.value='';"

__________________
Vormund is offline  
Old 09-05-2007, 04:23 AM   #3 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,686

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Javascript help needed

Perfect. Thanks a ton!
__________________

Need website help? PM me!
CrazeD is offline  
 
Closed Thread

Thread Tools
Display Modes

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
Javascript Object List: display and sort- How to? Anna ms Programming Discussions 1 08-04-2007 03:42 AM
2 last items needed, psu & heatsink-advice plse Hookster264 Building, Buying, or Upgrading High Performance PC Systems 14 07-12-2007 09:35 AM
Some Applications Arent Able to Connect to a Remote Server as Needed quazia83 Computer Networking & Internet Access 3 06-25-2007 01:47 PM
quick javascript help joe33 Programming Discussions 1 05-15-2007 04:29 PM
JavaScript Botnet Code Leaked To Internet Osiris Virus - Spyware Protection / Detection 0 04-02-2007 09:05 PM