Go Back   Computer Forums > General Computing > Programming
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 01-06-2011, 03:57 PM   #1
Beta Member
Join Date: Aug 2010
Posts: 2

This is probably the simplest thing ever for you guys. But I am trying to get into web design.

So here is what I am trying to do. I have two textboxes and i want the text inside the textbox to disappear when it is clicked, but I want it to reappear when the other textbox is clicked

Original Page

a) [Username] b) [Password]

If a is clicked.

a) [ ] b) [Password]

if b is clicked.

a) [Username] b) [ ]

if anywhere else on the page is clicked.

a) [Username] b) [Password]

Soo. that being said, here is what I have so far.



<br />
<input type="textbox" onclick=value="" value="Username" />
<br />
<br />
<input type="textbox" onclick=value="" value="Password" /> </p>


fubu05 is offline   Reply With Quote
Old 01-06-2011, 04:31 PM   #2
Site Team
berry120's Avatar
Join Date: Jul 2009
Location: England, UK
Posts: 3,422

Have a look here: Text box onclick event handling: removing default data

You'll need javascript to do this, but it's simple enough
Save the whales, feed the hungry, free the mallocs.
berry120 is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off

All times are GMT -5. The time now is 11:23 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0