Current location: Hot Scripts Forums » General Web Coding » JavaScript » input onclick


input onclick

Reply
  #1 (permalink)  
Old 02-04-08, 06:36 AM
blinn_shade's Avatar
blinn_shade blinn_shade is offline
Aspiring Coder
 
Join Date: Aug 2007
Posts: 540
Thanks: 0
Thanked 0 Times in 0 Posts
input onclick

Hey,

Can someone ell me how to make an input clear itself if the value of the input box is 0.00 & once they leave the input box it will return to 0.00 if they haven't entered a new value. I am on about a input text box.
Reply With Quote
  #2 (permalink)  
Old 02-04-08, 07:02 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
HTML Code:
<input
    type="text"
    value="0.00"
    onfocus="if (this.value == this.defaultValue) this.value = '';"
    onblur="if (this.value == '') this.value = this.defaultValue;"
 />
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
Multiple input box from combo-box qie JavaScript 7 05-04-07 07:39 AM
how to use onclick in php coolcoder HTML/XHTML/XML 2 05-31-06 12:40 PM
input fields. blackcode PHP 5 08-21-05 09:04 AM
Input Form Help kevinb HTML/XHTML/XML 4 02-12-05 08:05 AM
How come Account_Type and Organization cannot accept user input? toezaurus81 C/C++ 1 07-30-04 01:59 PM


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