Project / Support Center
Welcome, Guest. Please login or register. October 24, 2021, 01:21: PM
Home Help Search Login Register
D-Web Web Site Creator D - Web Web Site Creator On-line HTML Editor No Programming knowledge required. Web Global Net PayPal-Cart Shopping Cart System PayPal - Kart Shopping Cart System for E-Commerce over the internet, that's easy to use. Web Global Net Newsletter Manager Newsletter Manager On-line Newsletter Creator with Email Subscriber Management.
Ring Central Discount
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  Javascripting  |  Topic: clear default value in a text field when clicked in to 0 Members and 2 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Send this topic Print
Author Topic: clear default value in a text field when clicked in to  (Read 7880 times)
admin
Guest
« on: July 10, 2009, 12:30: PM »

Place this just above the </body> tag

<script type="text/javascript">
var inputs = document.getElementsByTagName("input");
for( var i = 0 ; i < inputs.length ; i++ ) {
 if(inputs.type=="text"||inputs.type=="password") {
  inputs.onfocus = function() {
   if(this.value==this.defaultValue) this.value = '';
  }
  inputs.onblur = function() {
   if(this.value=='') this.value = this.defaultValue;
  }
 }
}
</script>
</body>
Report to moderator   Logged
Pages: [1] Go Up Send this topic Print 
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  Javascripting  |  Topic: clear default value in a text field when clicked in to « previous next »
Jump to:  


Login with username, password and session length
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!