Guide to creating a web site, web design, web development, internet marketing, promotion, html tips and tricks, javascript and more.

Your Guide to Professional
Web Site Design and Development

HTML Codes
Web Development
Web Design Tips
JavaScript Codes
216 Web Safe Colors
CSS Tutorial
JavaScript Tutorial
ASCII Character Codes

Offering Free Javascript Tips, Snippets and Codes

Open Directory Projectfree ebooksfree articles
web site design development internet marketing and promotion tutorials

| Web Site Development | HTML Codes | HTML Tips | Web Design TipsJavascript Snippets | 216 Safe Colors | Symbols | CSS Tutorial | JavaScript Tutorial |

webmaster resources
website design

Disappearing Default Form Text

When using forms within your web site, there may be times when you will want to include an example of what you'd like your visitors to fill in your form field. Although you could place some default text within your form field, your users would need to delete the default text in order to type in their own information.

However, this cool little JavaScript code will enable you to display some example default text within a text box that will disappear when clicked on - much better than your users having to delete the example text.


Place your cursor inside the text box to see the text disappear.

Place your form code within your HTML like this:

<FORM action="" method="post">
<INPUT type="text" size="25" value="Enter Your Default Text Here" onFocus="if(this.value == 'Enter Your Default Text Here') {this.value = '';}" onBlur="if (this.value == '') {this.value = 'Enter Your Default Text Here';}" />
<INPUT type=submit value=Submit>

Change the default text displayed within your text box by editing the code indicated in bold.

Submit your JavaScript code snippets. We'll credit you and give you a link to your website.