Current location: Hot Scripts Forums » General Web Coding » JavaScript » Text box population


Text box population

Reply
  #1 (permalink)  
Old 11-09-05, 01:16 PM
Y3000's Avatar
Y3000 Y3000 is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
Text box population

Text box population... I've seen this around and wondered how it was done, and would like to use it in one of my new projects.

A page has a form on it, and when the page loads a text box in the form is pre populated with a value. If the text box is un-touched the default value is submitted with the form. However, if the user clicks the text box the default dissapears and they can enter their own.

Hope someone can help.
Many Thanks.
__________________
Adam
Reply With Quote
  #2 (permalink)  
Old 11-09-05, 03:53 PM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
as simple as:
Code:
<intput type="text" name="whatever" value="Default Value" onfocus="this.value='';" />
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #3 (permalink)  
Old 11-09-05, 04:09 PM
Y3000's Avatar
Y3000 Y3000 is offline
Newbie Coder
 
Join Date: Nov 2004
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
WOW! Thanks.
__________________
Adam
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using 'SELECT from' with value from a text box. steve711 PHP 1 06-17-04 06:37 PM
text box altafingar Visual Basic 2 05-08-04 10:20 PM
Visual basic text box altafingar Visual Basic 2 04-30-04 08:49 AM
MySQL Query problem Wraith PHP 5 03-06-04 05:16 PM
picking random entries with a filter... Double selection problem dsumpter PHP 7 11-16-03 07:19 PM


All times are GMT -5. The time now is 10:58 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.