logo
g Text Version
Beauty & Self
Books & Music
Career
Computers
Education
Family
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
Money
News & Politics
Relationships
Religion & Spirituality
Sports
Travel & Culture
TV & Movies

dailyclick
Bored? Games!
Nutrition
Postcards
Take a Quiz
Rate My Photo

new
Action Movies
Bible Basics
Houseplants
Romance Movies
Creativity
Family Travel
Southwest USA


dailyclick
All times in EST

Full Schedule
g
g ASP Site

BellaOnline's ASP Editor

g

Clearing a Form Field


Many uses of ASP involve forms, to process information from your users. Here's the super-easy way to have a prompt in a form field, but to have it vanish when the user clicks to type.

The most common application of this is with email addresses. You want the field to normally say something like "enter email here" so that the user knows that is what the field is for. However, that can easily result in you getting subscriptions to addresses like

enter email herejoesmith@aol.com

which is annoying. It's really easy to fix this. Let's say your field currently says:

<input type="text" name="email" size=30>

All you have to do is add an onClick command to it, that tells the system - when a user clicks, do something. The "something" you want to do is make this field blank. Therefore:


<input type="text" name="email" size=30 onClick="this.value=''">

That's all there is to it!
Add Clearing+a+Form+Field to Twitter Add Clearing+a+Form+Field to Facebook Add Clearing+a+Form+Field to MySpace Add Clearing+a+Form+Field to Del.icio.us Digg Clearing+a+Form+Field Add Clearing+a+Form+Field to Yahoo My Web Add Clearing+a+Form+Field to Google Bookmarks Add Clearing+a+Form+Field to Stumbleupon Add Clearing+a+Form+Field to Reddit




RSS | Related Articles | Editor's Picks Articles | Top Ten Articles | Previous Features | Site Map


For FREE email updates, subscribe to the ASP Newsletter


Past Issues


print
Printer Friendly
bookmark
Bookmark
tell friend
Tell a Friend
forum
Forum
email
Email Editor


Content copyright © 2014 by Lisa Shea. All rights reserved.
This content was written by Lisa Shea. If you wish to use this content in any manner, you need written permission. Contact Lisa Shea for details.

g


g features
Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter


vote
Poetry
Daily
Weekly
Monthly
Less than Monthly



BellaOnline on Facebook
g


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2014 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor