Update form handling to work with latest api changes.

Looks like the groovy example doesn't run with the current snapshot. Updated to reflect the new form api.

Cheers!