Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 06-04-2006, 07:51 PM   #1
BSOD
 
Join Date: Jun 2006
Posts: 41
Default quick javascript for a field anyone?

i was wondering if someone could find the quick script so i can have the login boxes like on vbulletin, where it says username but you click inside the username box and the text disappears...

go here:http://www.vbulletin.com/forum/

and click in the username box to get what im sayign

anyone know how, i couldnt get it from the source to the point where i understood it

Code:
<form action='login.php' method='POST'>
<table style='border:1px solid #000000;'>
<tr>
<td align='right'>
<input type='text' size='15' maxlength='25' name='username' value="Username">
</td>
</tr>
<tr>
<td align='right'>
 <input type='password' size='15' maxlength='25' name='password' value="password">
</td>
</tr>
<tr>
<td align='center'>
<input type="submit" value="Login">
</td>
</tr>

</table>
</form>
</center>
thats my login field
__________________

ZmxpcHBlcg== is offline   Reply With Quote
Old 06-04-2006, 07:54 PM   #2
BSOD
 
Join Date: Jun 2006
Posts: 41
Default Re: quick javascript for a field anyone?

nvm, lock thread found perfect solution

http://www.vbulletin.com/forum/archi...p/t-96406.html
__________________

ZmxpcHBlcg== is offline   Reply With Quote
Old 06-05-2006, 06:13 AM   #3
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,004
Default Re: quick javascript for a field anyone?

<input onclick="this.value=''" value="your@email" name="email_address" />
<input onmouseover="this.value=''" value="your@email" name="email_address" />

both work, but the best way (because not everyone uses a mouse. is (as you pointed out).

<input onfocus="this.value=''" value="your@email" name="email_address" />
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Reply

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 04:08 AM.


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