Sunday, December 14, 2003

interactive form

I've been playing with a little DOM scripting to enhance interactivity between form fields and labels in this Contact Form Test.

The fun part, for me anyway, is getting to expirement with this alternative label syntax:

<LABEL>
   <INPUT type="text" name="lastname">
   Last Name
</LABEL>

except I cheated and wrapped a span around the label text to make it easier to style and grab with the DOM. I was careful though to make the form usable before the JavaScript comes in and does it's thing. But with CSS turned off you'll be wishing I put in some break tags or paragraphs instead of just turning the labels into block level containers.

No comments: