ennuidesign.com
Submitted by: Jason Lengstorf

Beautiful Forms with JavaScript

The desired outcome of this script is to 1) create a standard comment form, 2) dynamically display form field descriptions inside each form field using the information stored in corresponding label elements, then write functions to 3) hide the description when the user focuses on a form field, and 4) replace the description inside the form field if the user navigates away without entering a value. Finally, just for good measure, we’ll 5) validate the form before submission to make sure the description doesn’t get posted as a comment.

direct link