ASP Is Fun

Learning ASP
Free Course
Basics
Functions
SQL Commands
Sample Code

Servers / Setup
Host Reviews
Server Setup
Error Tips

Contract ASP
Development

Search For:



Intro to ASP


 
ASP Intro Ebook


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!

ASP Form Creation and Security


ASP Main Page | ASP Ebooks | Free ASP Course | Contact Lisa
All content copyright © 2010 Minerva WebWorks LLC. All rights reserved.

French Wedding


Free Newsletter!

Ebooks
Intro to ASP
ASP SQL DB
Members
Shopping


Introduction to ASP

Romance Tips
Irish Romance
Italian Romance
French Romance

ASP Poll
How do you handle 500 errors?
I don't
Page does nothing
Displays error
Emails error