spacer
Web Development Tutorials CSS Tutorials
 Developer Newsletter

Tutorials
AJAX
ASP
CGI & Perl
CSS
Flash
HTML
Illustrator
Java
JavaScript
Linux
MySQL
PHP
Photoshop
Python
Wireless
XML
Miscellaneous


Scripts Directory
AJAX Scripts
ASP Scripts
ASP.NET Scripts
CGI & Perl Scripts
Flash Scripts
Java Scripts
JavaScript Scripts
PHP Scripts
Python Scripts
Remotely Hosted Scripts
Tools & Utilities Scripts
XML Scripts

Web Hosting Directory
ASP.NET
Budget
Dedicated Servers
Ecommerce
Linux
Resellers
Shared
Small Business
Windows

Developer Manuals
Learn HTML
Learn PHP
Learn CSS
Learn AJAX
Learn JavaScript
Learn Pear
Free White Papers

Developer Resources
Developer Tools
Developer Content
Survey Software
Dedicated Servers




Using CSS Selectors to Highlight Unedited Form Fields

By Tom Mollerus
2008-01-03


Using CSS Selectors to Highlight Unedited Form Fields

At An Event Apart Boston, CSS guru Eric Meyers mentioned an incredibly sensible technique for giving users a simple means of telling which fields in a form they still need to fill out: use attribute selectors in your CSS to highlight form fields which still have a default or empty value after the user submits the form.

In your stylesheet write...

input[value=""] {
background-color: #FFFFE1;
}

... and your form fields will be treated like the following...

Field 1:
Field 2:

This will color the background of any empty input field to a nice light yellow. Now your users can tell at a glance which fields they still need to fill out.



Tutorial Pages:
» Using CSS Selectors to Highlight Unedited Form Fields


 | Bookmark Print |   Write For Us
Related Tutorials:
» Planning Your Stylesheet - The Definitive Guide
» CSS Shorthand Properties
» Print Stylesheet - The Definitive Guide
» An Introduction to CSS
» Overlapping tabbed navigation in CSS
» Cascading Style Sheets - CSS



About the NetVisits, Inc Network | Write For Us | Advertise
Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy.
Visit other NetVisits, Inc. sites: