The fields below are initial blank/unset, but some JavaScript fills them in. This would seem to be a useful way of writing a common NewFoo/EditFoo PHP/JSP/whatever - generate the form to be blank, then if you're editing an existing record, use a separate chunk of JavaScript to fill the existing values in. Vaguely based on info in JavaScript book around pg 260.

An input field called field1:

A selector called choice: This field will be overwritten whenever you select something from 'choice': goodbye

A checkbox: This should change when checkbox is ticked or unticked